# this finds the links I do not want: my @links = $mech->find_all_links(url_regex => qr/foo/); # these (as well as some really bizarre attempts) don't work: my @links = $mech->find_all_links(url_regex => !qr/foo/); my @links = $mech->find_all_links(url_regex !~ qr/foo/);