in reply to Re: Defaults for command line args
in thread Defaults for command line args

The problem with this is that @ARGV could be non-empty but its elements could be undef or empty strings. So your test for "if (@ARGV)" would pass, but the variable would get assigned an empty string. Consider what happens if the scripts is called like this:
./prog.pl ""
In this case @ARGV is not empty, but its first element is an empty string.

--ZZamboni

Replies are listed 'Best First'.
RE: RE: Re: Defaults for command line args
by mdillon (Priest) on May 15, 2000 at 22:44 UTC
    yeah, i thought of that, but i was over editing my answer when i saw three other answers which together covered every aspect of the problem. i think the best is btrott's solution:
    my $infileold = shift || $fileold;