in reply to Re: Re: use strict; and command line options
in thread use strict; and command line options

That's not how you use command line options.

There are many ways to retrieve command-line parameters, below are two that I use often:
# method 1 use strict; die "you must provide command-line parameters" if ! @ARGV; print "command-line option: $_\n" for @ARGV; # method 2 use strict; use Getopt::Long; GetOptions ( 'useTR' => \{ my $useTR = 0 }, ); unless ( defined $useTR ) { die "Usage: $0 -useTR"; } # Then you use the $useTR variable onwards

Replies are listed 'Best First'.
Re: Re: Re: Re: use strict; and command line options
by hehenoobhehe (Novice) on Feb 11, 2004 at 03:45 UTC
    Thanks I now understand that i will have to use Getopt::Long and GetOptions. Thanks again.
Re: use strict; and command line options
by Abigail-II (Bishop) on Feb 11, 2004 at 10:39 UTC
    That's not how you use command line options.
    Says who? What's the -s for then? Just because its usuage is rare doesn't mean it's not supported and that you have to roll your own @ARGV parsing.

    Abigail

    perl -wlseprint -- -_=Just\ another\ Perl\ Hacker
      Thanks for the correction. I should have checked the perl usage more carefully. *blush*.