Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Range Operator in If Statement

by kejohm (Hermit)
on Jan 04, 2012 at 21:35 UTC ( #946297=note: print w/ replies, xml ) Need Help??


in reply to Range Operator in If Statement

If you are able to upgrade to a newer version of Perl, starting with v5.10, you can use the smart match operator, eg:

use 5.010; my $ref = 7; if ( $ref ~~ [ 1 .. 8 ] ) { ... }


Comment on Re: Range Operator in If Statement
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2014-07-24 06:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (158 votes), past polls