open(Input, '+<…') || die "No such file found!"; #### open my $input, '+<', 'file...'; #### perl script.pl > output.txt #### open STDOUT, '>', 'output.txt' or die $! #### perl first.pl | perl second.pl #### while (my $line = ) { ... }