http://www.perlmonks.org?node_id=935292


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