in reply to $mech help

As corion said, this has not much to do with WWW::Mechanize. It has somewhat to do with the Perl language, and lots to do with how you think about your problem.

Define your problem without thinking about code.

In a list of things, you know the name of one thing that you wish to skip, and you don't know the name of another thing that you wish to keep. So you need to go through the list, throw away the thing you don't want, and keep whatever is left. Right?

You may be looking for next.

foreach my $thing ( @things ) { next if $thing eq $known_junk; # exact string comparison; change a +s needed print "$thing\n"; # whatever's not junk }
Hope this helps!

The way forward always starts with a minimal test.