in reply to Best method of assigning "default" values?

How about defined?

my $val = defined($input_ref->{do_this}) ? $input_ref->{do_this} : "My + Default Value";
Of course, some monk more clever than I will figure out a way to shorten it ;)

Replies are listed 'Best First'.
Re^2: Best method of assigning "default" values?
by davidrw (Prior) on Jun 28, 2005 at 15:50 UTC
    exists might be preferable to definded if you want to distinguish the case of routine( do_this => undef ).
    OP -- There was also a very closely related discussion yesterday/this morning in the Hashes and keys... thread.