in reply to Re^2: Hashes and keys...
in thread Hashes and keys...
Also there are parameter checking modules out there.sub foo { my %defaults = { param1 = 'default1', param2 = 'default2', #etc } my $self = shift; my $params = { @_ }; for ( keys %defaults ) { $params->{$_} = $defaults{$_} unless defined $params->{$_}; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Hashes and keys...
by kaif (Friar) on Jun 28, 2005 at 11:58 UTC | |
|
Re^4: Hashes and keys...
by davidrw (Prior) on Jun 28, 2005 at 12:10 UTC |