#!/usr/bin/perl my $Pipe= ""; while (){ $Pipe .= $_; } print "This was read from the pipe:\n"; print "<$Pipe>\n\n"; print "This was the read from the parameters:\n"; print "<@ARGV>\n"; #### This was read from the pipe: This was the read from the parameters: <1 2 3 4> #### #!/usr/bin/perl $SIG{ALRM} = sub { warn "waited too long, exiting. This is what I have:\n"; report(); exit; }; alarm(2); # time out after two seconds my $Pipe= ""; while (){ $Pipe .= $_; } report(); sub report { print "This was read from the pipe:\n"; print "<$Pipe>\n\n"; print "This was the read from the parameters:\n"; print "<@ARGV>\n"; } #### waited too long, exiting. This is what I have: This was read from the pipe: This was the read from the parameters: <1 2 3 4>