in reply to Redirecting/Restoring of Memory Files
Well, perldoc does say:
You may also, in the Bourne shell tradition, specify an EXPR beginning with ">&", in which case the rest of the string is interpreted as the name of a filehandle (or file descriptor, if numeric) to be duped (as dup(2))And the UNIX system call dup works only with descriptors (files, pipes, FIFOs, sockets etc). So you probably shouldn't expect it to work with Perl data without an underlying descriptor.
The black hole goes away if I reopen using substr($s,length($s)) where $s is the original variable used to create the memory file handle.Or if you reopen in append mode, as in
} else { open($fh1, '>>', \$s1) or die "Can't restore fh1"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Redirecting/Restoring of Memory Files
by ELISHEVA (Prior) on Jun 26, 2015 at 07:10 UTC | |
by Discipulus (Canon) on Jun 26, 2015 at 09:19 UTC | |
by Anonymous Monk on Jun 26, 2015 at 08:30 UTC |
In Section
Seekers of Perl Wisdom