in reply to Difference between piped-in and invocation arguments to a Perl script?
This also works for redirecting files:#!/usr/bin/perl -w my $line = <STDIN>; print "Line is: " . $line; $ echo 'echo' | ./teststdin.pl Line is: echo
Hope this helps!$ cat echo.txt echoed file $ ./teststdin.pl < echo.txt Line is: echoed file
|
|---|