For the quick rundown:
Sub routines can be referenced, and then later dereferenced for access. Useful if you need to create an option handler or something:
$opt = "opt" . $ARGV[0]; $subhash = { opt1 => sub { print "This is option one"; }, opt2 => sub { print "This is options two"; } }; # indicate a function when dereferencing with & &{$subhash->{$opt}};
In reply to Re: Anonymous Subroutines
by dsb
in thread Anonymous Subroutines
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |