I am looking for a short form for...Well, assuming %{$vxdgs}{$node} isn't a tied hash with side-effects, and $vxdgs{$node}{$disk} isn't a tied scalar with side-effects, your code is a noop. Both blocks assign something to a scalar variable, with both scalars going out of scope directly after the assignment.if (exists $vxdgs{$node}{$disk}) { my $vxdg=$vxdgs{$node}{$disk}; } else { my $vxdg=""; }
In reply to Re: Short form (ternary) if else
by JavaFan
in thread Short form (ternary) if else
by gg48gg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |