Neil Montgomery <> wrote:
> I have solved my actual programming problem, but was frustrated in my
> attempt to determine the behaviour of @ARGV in the online docs.
@ARGV is an array of _data_.
Data does not _have_ behaviour, code does.
So it must be something else...
> I need to keep track of which file each datum came from.
> while (<>) {
Now we're getting somewhere.
There is an _op_erator that we know makes use of the data in @ARGV.
> and concluded that the
> elements of @ARGV are being 'shift'ed, but I wasn't able to find this
^^^^ ^^^^^
> behaviour documented the online docs (perlvar, perlop, perlsyn, perldoc
> -q, probably others).
It ought to be in perlop.pod somewhere, but it took me a while to
find it too. The FAQ calls it the "diamond operator" but perlop
calls it the "null filehandle".
But you had the search terms that led me to find it:
grep ARGV *.pod | grep shift
See the "I/O Operators" section:
The null filehandle <> is special
...
It really does shift the @ARGV array
--
Tad McClellan SGML consulting
Perl programming
Fort Worth, Texas