On Fri, 29 Jun 2001, James Kelty wrote:

> I am trying to take "-l" or "-list" as a command line argument, but it
> bombs out with this error when run.

Perl, by default, will treat a command-line option as a file, so you also
need to make sure you shift it off the @ARGV array if you are going to use
it directly.  In fact, the first thing you should do is shift out the
@ARGV elements you want to use instead of using @ARGV elements directly,
which you are doing.

Better yet, take a look at Getopts::Std or Getopts::Long for a very clean
way of using command-line switches.

-- Brett
                                   http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
Some men feel that the only thing they owe the woman who marries them
is a grudge.
                -- Helen Rowland


Reply via email to