# $@ being the shell's quoted argument list perl program1 $@ | perl program2 #### # program1.pl ... print while(); # program2.pl (which is reading program1.pl's output) ... while(my $line = ) { do_something($line); }