Help for this page

Select Code to Download


  1. or download this
    use warnings;
    use strict;
    use Getopt::Long;
    ...
    if ($foo) {
        print $foo =~ /!(.*)/ ? "All but $1" : "Only $foo";
    };
    
  2. or download this
    bash$ perl all-but-foo.pl --foo 4
    Only 4
    bash$ perl all-but-foo.pl --foo \!4
    All but 4