Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: conditional syntax options

by citromatik (Curate)
on Jun 28, 2009 at 14:30 UTC ( #775465=note: print w/replies, xml ) Need Help??


in reply to conditional syntax options

The code you provide is clear and concise enough, I would stay with it. But, just for curiosity, since Perl 5.10 you can use the smart-match (~~) operator for a shorter alternative (see perlop):

  • if (! $string ~~ qw/A B/)
  • if ($string ~~ qw/A B/)
  • citromatik

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://775465]
help
Chatterbox?
[Discipulus]: good morning monks! or whatever daypart you are experiencing..
choroba . o O ( workpart )

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2017-02-21 08:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (308 votes). Check out past polls.