in reply to Better way of matching
The nice thing is that you can cascade them to make readable tableish structures:($net eq $x) ? 1 : 0; is the same as if ($net eq $x) { return 1; } else { return 0; }
($x eq $y) ? _do_something() : ($x eq $z) ? _do_something_else() : ($x eq $w) ? _do_a_third_thing() : _do_default_thing;
-- Kirby, WhitePages.com
|
|---|