Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Range Operator in If Statement

by ww (Bishop)
on Jan 04, 2012 at 22:12 UTC ( #946302=note: print w/ replies, xml ) Need Help??


in reply to Range Operator in If Statement

Another way, perhaps even related to the code in OP:

#!/usr/bin/perl use Modern::Perl; # 946284 my $ref = 7; for (1 .. 8 ) { if ($ref == $_) { say "\$ref: $ref"; # adjust output to id source of match? } else { say "Tain't workin'"; } }

Seems to me this might be readily expansible to your larger goal as outlined in Re^2: Range Operator in If Statement


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://946302]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2014-09-20 14:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (159 votes), past polls