There's more than one way to do things | |
PerlMonks |
Re: How do I treat a string like a filehandle?by davido (Cardinal) |
on Oct 02, 2003 at 03:55 UTC ( [id://295808]=note: print w/replies, xml ) | Need Help?? |
You may open a file handle to "in memory" files (ie, scalars... or strings), if you're using a new enough version of Perl. I believe this feature was introduced with 5.8.0.
Per perlfunc:open; 'File handles can be opened to "in memory" files held in Perl scalars via:Though if you try to re-open STDOUT or STDERR as an "in memory" file, you have to close it first.' Another example provided in the POD is:
In Section
Seekers of Perl Wisdom
|
|