more useful options | |
PerlMonks |
open to a scalar variableby girarde (Hermit) |
on Jun 04, 2007 at 21:42 UTC ( [id://619237]=perlquestion: print w/replies, xml ) | Need Help?? |
girarde has asked for the wisdom of the Perl Monks concerning the following question:
Per the open manpage, I am attempting to open a filehandle to a variable in memory and I am unable to read the variable. My code looks like this:
after which much is written to the handles using various formats, and an attempt to get the data is made so:
The result is: Use of uninitialized value in print at check_remove.pl line 85. where line 85 is the print $text line. Opening MESSAGE in different modes does not yield better results. For instance, using the syntax in the open manpage results in a Filehandle MESSAGE opened only for output error. It works OK if I omit the handles and point the formats at STDOUT, but I am on Win32 and want to mail the output, so piping the output to SENDMAIL won't help. I was going to use Mail::Sendmail, which is why I want the output in a scalar. What am I missing?
Back to
Seekers of Perl Wisdom
|
|