This simple snippet allows the power commandline user to perform multiple commands based on the unified output of a single command.

ie:
$ ps -aef | pipe.pl 'grep orien >qi3ber.log' | grep root >root.log
#!/bin/perl -w use strict; open PIPE, "|@ARGV" or die if @ARGV; if ( @ARGV ) { select PIPE; } else { select STDERR; } while (<STDIN>) { print STDOUT $_; print $_; }