in reply to Save/restore STDIN

Take a look on that, without local():
## save: my $stdin_org ; open($stdin_org,"<&main::STDIN") ; ## redirect: open(main::STDIN,"<$0") ; ##restore: *main::STDIN = $stdin_org ; ## use main:: to really restore the main + STDIN.
This is just a guess, I haven't testd it yet!

Graciliano M. P.
"Creativity is the expression of the liberty".