$sym = gensym; open($sym, "filename"); #### #!/usr/bin/perl -w use strict; sub writelog{ my ($file,@text) = @_; my $fh; open($fh,">>",$file) || return undef; print $fh "--- ",time," ---\n"; print $fh "$_\n" foreach (@text); close($fh); return 1; } writelog("logfile","using lexically scoped var");