in reply to Re^2: WWW::Mechanize and following multiple links
in thread WWW::Mechanize and following multiple links

Those while loops that you are excluding are the primary danger here; the problem scenario usually manifests something like:
sub foo { while (<$fh>) { ... } } for (@important) { ... foo(); ... }
and presto, elements in @important are replaced by lines from $fh.