in reply to how to write a subroutine content into a file
Orsub doit{ return "How are you?\n"; } open (FILE, ">files.txt"); print FILE &doit; close(FILE);
Or .. lots of ways.sub doit{ my $handle = shift; print $handle "How are you?\n"; } open (FILE, ">files.txt"); doit(*FILE); close(FILE);
|
---|