#!/perl/bin/perl use LWP::UserAgent; use LWP::Simple; $getURL = "http://localhost/~owner/50.htm"; $script_name = "Fetcher"; print "Content-type: text/html\n\n"; $page_data; $content_type; $request; $response; $fiftypath = "data/fifty.dat"; $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->agent("$script_name"); $request = HTTP::Request->new('GET',$getURL); $response = $ua->request($request); #@page_data = $response->content; @page_data = ; foreach $line (@page_data) { if ($line =~ /class=\"fifty\">([^<]+)<\/a>/) { open (LOG,">>$fiftypath"); flock(LOG, 2); print LOG "$1"; flock(LOG, 8); close(LOG); print "$1"; } } __DATA__
1 Pam Anderson
Stacked
nc #1 295
1 Paris Hilton
Nicole Out
nc #2 65