in reply to Re: Override "null filehandle"
in thread Override "null filehandle"
That's not quite true:
% echo This is from STDIN|perl -e'print for <>' This is from STDIN % echo This is from ARGV > input1 % echo This is also from ARGV > input2 % perl -e'print for <>' input1 input2 This is from ARGV This is also from ARGV
The <> operator looks first at at @ARGV and iterates line by line through each file specified as arguments to the script. But if there are no arguments (@ARGV is empty) then it falls back to reading from STDIN. This behaviour is documented in perlop, already linked to by the OP.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Override "null filehandle"
by haukex (Archbishop) on Sep 04, 2023 at 09:40 UTC | |
|
Re^3: Override "null filehandle"
by ikegami (Patriarch) on Sep 05, 2023 at 22:06 UTC |