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);
In reply to Re: how to write a subroutine content into a file
by mrstlee
in thread how to write a subroutine content into a file
by Pal-Cod3r
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |