I don't see any use of this proposed new exists (or any existance test at all for that matter) there. What are you trying to show? As BrowserUk said what I'd write then would bedo {my $tmp = $_ -> {$client}; return $$tmp if $tmp;} for $export_def->{'..client_default_version +'};
For the purpose of demonstration, you can even avoid assignments altogether:return $$_ if $_ = exists $export_def->{'..client_default_version'}{$client};
{ return ${ exists $export_def->{'..client_default_version'}{$client} or last } }
Yes, if I forget the sigil on $client I'll still get strange results, but having to get it right twice still offers more room for failure, not to mention the fact that if I get the sole instance of it wrong I will get consistent rather than intermittent failure which is far easier to notice and track.
I stand by my point, this proposition is A Good Thing in terms of promotion of good programming practices.
Makeshifts last the longest.
In reply to Re^3: optimization - exists should return a reference
by Aristotle
in thread optimization - exists should return a reference
by John M. Dlugosz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |