more useful options | |
PerlMonks |
how to write a subroutine content into a fileby Pal-Cod3r (Initiate) |
on Nov 08, 2011 at 09:14 UTC ( [id://936691]=perlquestion: print w/replies, xml ) | Need Help?? |
Pal-Cod3r has asked for the wisdom of the Perl Monks concerning the following question:
I tried to make a script that write a subroutine content into a file but when i run it i received in the file: 1 and the code could be like this: sub doit{ print "How are you?\n"; } open (FILE, ">files.txt"); print FILE &doit; close(FILE); what is the wrong in this code and what shall i do to receive a word (How are you?) in the files.txt Please answer my question . Best Wishes.
Back to
Seekers of Perl Wisdom
|
|