sub appendfile($@) { my $f = shift; local *F; open(F, ">>$f") or die "appendfile:cannot open $f:$!"; print F '' unless @_; while (@_) { print F shift(@_) } close(F) }