This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use strict; | |
use warnings; | |
use feature ":5.10"; | |
my @ar = qw( a b c d ); | |
my $ar_ref = \@ar; | |
say @ar; # abcd | |
say @$ar_ref; # abcd - same array, so same contents |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my $opt_parser = OptParser->new(); | |
$opt_parser->add_option( | |
name => "foo" # name used to refer to this option | |
short => "f" # use as -f | |
long => "foo" # use as --foo | |
depends => "bar|baz" # option only valid if bar or baz is specified. using | |
# an array to list depends may be simpler... or not | |
conflicts => "buh" # option conflicts with option buh. |
NewerOlder