in reply to Calling a Perl filter script from command line

Pipes don't pass stuff via ARGV, you need to read from STDIN in order to get information from them. For example,

if you were to make a test file called test.pl with the lines
#!/usr/bin/perl -w
print <STDIN>;

in it, then do a "cat test.pl |./test.pl"
it would print:
#!/usr/bin/perl -w
print <STDIN>;

-Ryan

  • Comment on Re: Calling a Perl filter script from command line

Replies are listed 'Best First'.
(tye)Re2: Calling a Perl filter script from command line
by tye (Sage) on Jan 05, 2001 at 23:18 UTC

    Yes, pipes don't pass stuff via @ARGV, but <> does read from STDIN if @ARGV is empty. So <> is appropriate and that is not the problem.

            - tye (but my friends call me "Tye")