my $max_xy = ($x,$y)[$x<$y]
That reminds me about a variation of this gem I seem to remember being in Effective Perl Programming. Not as efficient, but more artistic. If I remember correctly, it's like this:
my $max_xy = [$x=>$y]->[$x<=$y];
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In reply to Re^2: assigning the maximum of two numbers
by xdg
in thread assigning the maximum of two numbers
by bageler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |