Don't ask to ask, just ask | |
PerlMonks |
Re^2: assigning the maximum of two numbersby EvanCarroll (Chaplain) |
on Nov 03, 2005 at 03:09 UTC ( [id://505205]=note: print w/replies, xml ) | Need Help?? |
I just feel compelled to reply: my $max_xy = ($x,$y)[$x<$y] I have never seen that before. You get +100 Evan points for that show of cunning. I plan to write programs around this in the future. I feel it worthy to note though that you lack a special vital caveat. Your code can be borked if one utilizes $[, ex $[=1, You might want to append it slightly: my $max_xy = ($x,$y)[abs( ($x<$y)+$[ )]; Evan Carroll www.EvanCarroll.com Grandfather WINS!Congratulations on your inabliity to pick up on a joke, your prize.. Amulet of a Sense Of Humor (+5 Sense Of Humor). With the amulet equiped your sense of humor is now: 5Congrats again.
In Section
Meditations
|
|