Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: General Advice

by hbm (Hermit)
on Jun 27, 2013 at 01:31 UTC ( #1040888=note: print w/replies, xml ) Need Help??


in reply to General Advice

use strict; use warnings; catches one error - a missing paren.

I'd build $negative_regex in one pass:

my $negative_regex = join '|', map { s/^-//, $_ } @$negative_criteria;

And test both regexes in one pass:

foreach(@$data) { push @$results, $_ if /$match_regex/ && !/$negative_regex/; }

Replies are listed 'Best First'.
Re^2: General Advice
by Anonymous Monk on Jun 27, 2013 at 02:53 UTC

    use strict; use warnings; catches one error - a missing paren.

    No , perl catches syntax errors

Re^2: General Advice
by yoda54 (Monk) on Jun 27, 2013 at 01:40 UTC
    Thanks!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2021-09-17 03:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?