sub process() { my $url = shift; $mech->get( $url ); my $html = $mech->content(); # Do all kinds of stuff w/ $html, including get() other pages, and login() to forms; $html = $mech->content(); return $html } #### require( 'my_subs.pl' ); my $mech = WWW::Mechanize->new(); my $datadir = "/tmp/logs"; foreach ( @url ) { my $returned_html = &process( $_ ); # Bob Loblaw }