in reply to Best method of assigning "default" values?
Yet another way, set up defaults when you construct the hash,
That way your defaults are in the hash to start with, and can be overridden by anything the user wants to assign. Less logic to go wrong.sub routine { my $input_ref = { var1 => '', var2 => $VAR2, # . . . @_ }; my $var1 = $input_ref->{var1}; my $var2 = $input_ref->{var2}; # ...etc... }
After Compline,
Zaxo
|
|---|