my $index = shift; my $mech = WWW::Mechanize->new(); $mech->get( "http://vortex.plymouth.edu/uacalplt-u.html" ); my @links = $mech->links; for my $link ( $mech->links ) { # do whatever }