use feature 'state'; use WWW::Mechanize 'new'; my $mech = WWW::Mechanize->new(); #$mech->get('http://www.google.co.il'); $mech->get('http://tv.walla.co.il/?w=/2//200//2011-05-14/1'); my $content = $mech->content( format => 'text' ); writeFile('Out.txt',$content); print "got\n"; print $content; print "\nand thats it\a\n"; sleep 10; sub writeFile #form: writeFile(path,content) { my $filepath = shift; my $nwntnt = join("",@_); $nwntnt = "\x{feff}".$nwntnt; #utf8 char starter open(txt, ">:utf8",$filepath); print txt $nwntnt; close txt; }