in reply to Get all outbound links with WWW::Mechanize?
The easy way is to just pull all links and apply your regular expression outside:
... my @outbound_links = grep { $_->url !~ qr!^https?://$hostname/! } $mec +h->find_all_links; ...
The harder way is to make your regular expression look ahead and ensure that it doesn't match:
my @outbound_links = $mech->find_all_links( url_abs_regex => qr<^(?!https?://\Q$hostname\E/)>, );
|
|---|