Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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

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 perusing the Monastery: (9)
As of 2016-08-26 07:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (366 votes). Check out past polls.