Help for this page

Select Code to Download


  1. or download this
    use strict; use warnings;
    use Getopt::Long;
    ...
            '--dir=s' => \$adir,
    ) or die "error in command line\n";
    print "ARGV after: ".join(" ", @ARGV)."\n";
    
  2. or download this
    # execute:
    ./getopt_long.pl  --dir d1 --job some-job -fw "hello" --file f1
    ARGV before: --dir d1 --job some-job -fw hello --file f1
    ARGV after: --job some-job -fw hello
    # notice how --file is after --job but still processed