Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Range Issue with RegEx

by VSarkiss (Monsignor)
on Jul 10, 2006 at 15:59 UTC ( #560173=note: print w/replies, xml ) Need Help??


in reply to Range Issue with RegEx

As above, I'd recommend using number equality instead of regular expressions if that's what you really mean. The range operator and grep are handy for this, like in this (untested) snippet:

while (<DATA>){ chomp; $tag = $_; if (grep {$tag == $_} 500..503,531,532) { print "$tag\n"; } }
(Remember that the $_ in the grep expression is not the same as the $_ in the while loop. More info at grep.)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://560173]
help
Chatterbox?
[1nickt]: marioroy Yes, I am using it with MCE, as is Discipulus I believe. I was trying to work out how to make a cpanfile that would be smart enough to know which deps to require.
[1nickt]: See this code. (I expected to simply eval loading threads as a check, but weirdness happened with Perlbrew so it's a grep of -V ...)
[choroba]: Config might be better than grepping -V
[Corion]: Also see Config::V, which is less of that hackery, or that hackery hidden in a module ;)
[1nickt]: The problem was with Perlbrew
[Corion]: Whoops - Config::Perl::V

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (14)
As of 2017-10-18 15:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (249 votes). Check out past polls.

    Notices?