Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Negate link search in Mechanize

by mwp (Hermit)
on Nov 02, 2011 at 04:57 UTC ( #935292=note: print w/replies, xml ) Need Help??


in reply to Negate link search in Mechanize

You might be over-thinking it.

my @links = grep $_->url !~ /foo/, $mech->links;

Update: I might be under-thinking it. :-)

Update 2: ology points out Negation/Complement of a Regex, which leads into a twisty labyrinth of prior art, including Negating Regexes: Tips, Tools, And Tricks Of The Trade.

mwp

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935292]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2017-09-21 05:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (242 votes). Check out past polls.

    Notices?