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
In reply to Re: Redirecting/Restoring of Memory Files
by flexvault
in thread Redirecting/Restoring of Memory Files
by ELISHEVA
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |