|
|
| Don't ask to ask, just ask | |
| PerlMonks |
Re: How would you shorten this regexp conditional?by japhy (Canon) |
| on Jan 25, 2002 at 17:23 UTC ( #141491=note: print w/ replies, xml ) | Need Help?? |
|
I'd just use the ternary operator:
my $color = $white =~ /princepawn/ ? 'w' : 'b';
_____________________________________________________
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||