in reply to Using a 'getopt' in module code

Why don't you rewrite the subroutine to take named parameters as a hash like so?

sub func { my %args = ( # default options option1 => "Foo", option2 => "Bar", @_, # passed options ); if ($args{option1}) { ... } if ($args{option2}) { ... } } func(option1 => "Foozball", option2 => "Barracuda");


perl -e '$,=$",$_=(split/\W/,$^X)[y[eval]]]+--$_],print+just,another,split,hack'er