in reply to Re^2: diamond operator
in thread diamond operator

<> only reads from STDIN if @ARGV is empty:

@ARGV=($0,$0,$0); print for <>;

Replies are listed 'Best First'.
Re^4: diamond operator
by Marshall (Canon) on Jun 09, 2009 at 17:56 UTC
    I learned something. THANKS Corion!
    I would not have thought that: while(<>) would try to open a command line arg as a file! But evidently it will!

    C:\TEMP>cat corion.pl #!/usr/bin/perl -w use strict; while (<>) { print $_;} C:\TEMP>perl corion.pl a b c Can't open a: No such file or directory at corion.pl line 4. Can't open b: No such file or directory at corion.pl line 4. Can't open c: No such file or directory at corion.pl line 4.