in reply to A smart way to handle @ARGV

You can use:

  1. Getopt::Std Getopt::Long or any of the other Getopt:: modules
  2. use the -s argument the invokes perls native ARGV parsing.
  3. hand parse @ARGV (ick)

I have grown to like -s due to its simplicity. BrowserUk introduced to me to it. Here is a short example:

#!/usr/bin/perl -sw use strict; our $FILE; our $CAT ||= 79; our $VERBOSE ||= 1; die "Usage: $0 -FILE=list [-CAT=$CAT] [-VERBOSE=$VERBOSE]\n" unless $FILE and -f $FILE;

cheers

tachyon

Replies are listed 'Best First'.
Re^2: A smart way to handle @ARGV
by Scarborough (Hermit) on Jul 08, 2004 at 09:54 UTC
    Thanks for this I think this should solve my problem.