in reply to Save/restore STDIN
It may be simpler to just localize *STDIN,
Explicit duplication is sometimes necessary, but not usually.{ open local(*STDIN), '<', "whatever" or die $!; # go on with processing, # calls to any sub will think STDIN is # the one you just set up. # ... close STDIN or die $!; } # old STDIN is restored, never been touched.
After Compline,
Zaxo
|
|---|