in reply to Redirecting/Restoring of Memory Files
Hello ELISHEVA,
I'm not sure I understand what you are trying to do. Your description implies to me that you are trying to save a file handle for later use, but your trying to use I/O to a scalar in memory.
You are opening a defined but empty string variable by passing a reference to the string. This maybe a new feature of Perl that I'm not aware of, but usually you open a file on an external media.my ($s1, $s2) = ('',''); . . . open(my $fh1, '>', \$s1) or die "Can't open fh1";
More clarification will be needed to give a better answer, but if you want to save the file handle ( $fh1 ) for later use, you could use a hash or array, which will preserve the definitions of $fh1.
Regards...Ed
"Well done is better than well said." - Benjamin Franklin
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Redirecting/Restoring of Memory Files
by ELISHEVA (Prior) on Jun 25, 2015 at 15:34 UTC | |
by flexvault (Monsignor) on Jun 25, 2015 at 18:42 UTC |
In Section
Seekers of Perl Wisdom