in reply to ARGV as a sub name?

Can't shed all that much light on the issue, but I can point out the following from ARGV in perlvar:

ARGV

The special filehandle that iterates over command-line filenames in @ARGV . Usually written as the null filehandle in the angle operator <> . Note that currently ARGV only has its magical effect within the <> operator; elsewhere it is just a plain filehandle corresponding to the last file opened by <> . In particular, passing \*ARGV as a parameter to a function that expects a filehandle may not cause your function to automatically read the contents of all the files in @ARGV .

ARGV: It's more than just an array!

Update: And if you really want to do what you appear to want to do, running this script:

#!/usr/bin/perl use strict; use warnings; package foo; sub fake_ARGV { print "in foo::ARGV\n" } no warnings "once"; *foo::ARGV = *foo::fake_ARGV; package main; foo->ARGV; print $ARGV[0];
does this:

~/sandbox$ perl test.pl 'Still here' in foo::ARGV Still here

Replies are listed 'Best First'.
Re^2: ARGV as a sub name?
by james2vegas (Chaplain) on Aug 18, 2010 at 21:24 UTC
    That is not required, all is required is this:
    package foo; use strict; sub foo::ARGV { print "in foo::ARGV\n" } package main; foo->ARGV;