mifflin has asked for the wisdom of the Perl Monks concerning the following question:
...
File handles can be opened to "in memory" files held
in Perl scalars via:
open($fh, '<', \$variable) || ..
...
I was wondering if it was possible to do the same with IO::File.
I've tried
But it does not work.use IO::File; $var = <<EOT; line 1 line 2 line 3 EOT ###open($fh, '<', \$var) || die $!; # this works # $fh = IO::File->new('<', \$var) || die $!; # but this does not # while ($line = $fh->getline()) { print $line; } $fh->close();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: opening anonymous temp files with IO::File?
by Juerd (Abbot) on May 12, 2004 at 18:37 UTC | |
|
Re: opening anonymous temp files with IO::File?
by Matts (Deacon) on May 12, 2004 at 19:47 UTC | |
|
Re: opening anonymous temp files with IO::File?
by Steve_p (Priest) on May 12, 2004 at 18:47 UTC | |
|
Re: opening anonymous temp files with IO::File?
by rob_au (Abbot) on May 12, 2004 at 21:02 UTC |