in reply to One-liner to rule them all...

Another hint which may be useful:

open SHELL,"|-","/bin/sh" || die "$!";

This opens a filehandle pointing to the child process' STDIN. You may want to do it in the BEGIN{} block if you're running your script with #!/usr/bin/perl -n.

Sorry if my advice was wrong.