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
In reply to Re^2: How do I...Conditional hash value
by Anonymous Monk
in thread How do I...Conditional hash value
by S_Shrum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |