![]() |
|
There's more than one way to do things | |
PerlMonks |
Printing to a File from Subby PyrexKidd (Monk) |
on Aug 26, 2010 at 17:44 UTC ( #857522=perlquestion: print w/replies, xml ) | Need Help?? |
PyrexKidd has asked for the wisdom of the Perl Monks concerning the following question: How do I print to a file from a sub routine when using strict subs? I have a program that opens a file in the main portion of the code and then calls a sub that needs to print to the same file as well. I would like to avoid opening and closing the file every time I have to write to it. In Java I would open the file in the main sub and then pass the file as an object to whatever sub nees to print to it. ie:
is there a way to do this in Perl? thanks in advance
Back to
Seekers of Perl Wisdom
|
|