use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->get($url); my $file_content = $mech->content() while(<$file_content>){ # do something }