use LWP::Simple; #each page is actually processed in a subroutine but you get the idea $page1 = "http://www.first.com"; $page1 = get($page1); #rest of the pages in same format here $pageN = "http://www.last.com"; $pageN = get($pageN);