in reply to Preferred technique for named subroutine parameters?

I like the hash method combined with Params::Validate which nicely does what it says on the can and is great value for money. Give it a try !
use Params::Validate qw/:all/; # MyModule->new(foo => 'val1', bar => 'val2') sub new { my $class = shift; my %args = validate(@_, { foo => 1, bar => 0 }); # foo required; b +ar optional ... }

Replies are listed 'Best First'.
Re^2: Preferred technique for named subroutine parameters?
by shmem (Chancellor) on May 23, 2009 at 22:40 UTC
    I like the hash method

    Plain list not hashref, I would say by your example ;-)