I don't know if it's any better or worse than using a new filehandle, but it keeps me happy.
It's exactly as the same IMHO and in both ways it keeps me unhappy: I find your way to do what you want to do clumsy and error prone, which is probably the reason why I couldn't understand your question at all, first.
BTW: What would I do on a non-posix system?
But seriously, why don't you use <>'s magic instead?
q:~/tmp [22:37:14]$ cat headybrew.pl #!/usr/bin/perl chomp(my @msg =<>); print @msg, "\n"; print "What do you want to do with this message?"; $response = <STDIN>; print $response; q:~/tmp [22:37:17]$ ./headybrew.pl 'ls|' headybrew.plheadybrew.pl~ What do you want to do with this message?foo foo
In reply to Re^3: the greedy diamond, or leggo my STDIN
by blazar
in thread the greedy diamond, or leggo my STDIN
by headybrew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |