Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: How would you shorten this regexp conditional?

by japhy (Canon)
on Jan 25, 2002 at 17:23 UTC ( [id://141491]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $color = $white =~ /princepawn/ ? 'w' : 'b';
  2. or download this
    my $color = ('b','w')[$white =~ /princepawn/];

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://141491]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 09:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found