in reply to Re: How do I...Conditional hash value
in thread How do I...Conditional hash value
Yes that should work... Also see:
--Divuse Data::Dumper; my $i1 =1; my %hash = (k1 => {k2 => ($i1 ? 'this' : 'that') }); print Dumper(\%hash) . "\n"; # this $i1 = 0; %hash = (k1 => {k2 => ($i1 ? 'this' : 'that') }); print Dumper(\%hash) . "\n"; # that
|
|---|