in reply to Re^2: Hashes and keys...
in thread Hashes and keys...
Basically, depending on your data/requirements, if( $p->{value}) and if(exists $p->{value}) are not the same.sub foo { my $obj = shift; my $p = { @_ }; my $value = exists $p->{value} ? $p->{value} : die "must give 'value +', even if undef or ''"; if( exists $p->{optional_but_possibly_blank_key} ){ ... }
|
|---|