Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
        print "Option -$_[0] is value=$_[1]\n";
        $args{$_[0]} = $_[1];
    }
    
  2. or download this
    $ ./test.pl -t asdf -c qwer
    Warning: arg -t without preceding -c: arg -t ignored at ./test.pl line
    + 13.
    Option -c is value=qwer
    Error: argument processing did not complete successfully at ./test.pl 
    +line 18.
    
  3. or download this
    use strict;
    use warnings;
    ...
        print "Option -$_[0] is value=$_[1]\n";
        $args{$_[0]} = $_[1];
    }
    
  4. or download this
    $ ./test.pl -t asdf -c qwer
    Error: arg -t without preceding -c: processing terminated at ./test.pl
    + line 13.
    
  5. or download this
    use strict;
    use warnings;
    ...
        print "Option -$_[0] is value=$_[1]\n";
        $args{$_[0]} = $_[1];
    }
    
  6. or download this
    $ ./test.pl foo -t bar -c baz
    Frobnicating foo
    Error: arg -t without preceding -c: processing terminated at ./test.pl
    + line 13.