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

Re: Range Operator in If Statement

by LanX (Canon)
on Jan 05, 2012 at 01:40 UTC ( #946312=note: print w/ replies, xml ) Need Help??


in reply to Range Operator in If Statement

Just to clarify why your tests don't throw errors:

When you're using the .. range operator in scalar context, you are actually getting the flip-flop behavior!

see Range Operators

I recommend combining two <= operators with &&, testing for inclusion after generating temporary lists is too much overhead. There is nothing closer to Python's 1 <= x <= 8 in Perl.

HTH

Cheers Rolf


Comment on Re: Range Operator in If Statement
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (19)
As of 2014-07-31 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (249 votes), past polls