palkia has asked for the wisdom of the Perl Monks concerning the following question:
Hi everyone
I used the pp module (this one) to convert my perl code to exe.
I wrote a simple code to extract some text from an online page with (this) WWW:Mechanize.
(The page contains Hebrew characters)
My code works gr8 as .pl but after it's converted to .exe with the pp module,
it gets a strange encoded (I think) text, that I can't understand nor convert to it's standard form.
Another weird thing is that the .exe created version of out.txt is about 4 times longer than the .pl's.
(tried & failed to convert with some functions from the utf8 pragma )
Suggestions ?
thx
My code (at least it's relevant part):
I used the pp module (this one) to convert my perl code to exe.
I wrote a simple code to extract some text from an online page with (this) WWW:Mechanize.
(The page contains Hebrew characters)
My code works gr8 as .pl but after it's converted to .exe with the pp module,
it gets a strange encoded (I think) text, that I can't understand nor convert to it's standard form.
Another weird thing is that the .exe created version of out.txt is about 4 times longer than the .pl's.
(tried & failed to convert with some functions from the utf8 pragma )
Suggestions ?
thx
My code (at least it's relevant part):
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; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: pp module messes encoding
by GrandFather (Saint) on May 13, 2011 at 23:41 UTC | |
by palkia (Monk) on May 14, 2011 at 00:33 UTC | |
by GrandFather (Saint) on May 14, 2011 at 04:41 UTC | |
by palkia (Monk) on May 14, 2011 at 18:28 UTC | |
by Anonymous Monk on May 15, 2011 at 06:37 UTC | |
by Khen1950fx (Canon) on May 14, 2011 at 02:07 UTC | |
by Anonymous Monk on May 14, 2011 at 08:58 UTC | |
Re: pp module messes encoding
by ZJ.Mike.2009 (Scribe) on May 14, 2011 at 10:39 UTC | |
by palkia (Monk) on May 14, 2011 at 15:17 UTC | |
by ZJ.Mike.2009 (Scribe) on May 15, 2011 at 05:45 UTC | |
by palkia (Monk) on May 17, 2011 at 00:46 UTC | |
by Anonymous Monk on May 14, 2011 at 10:58 UTC | |
by ZJ.Mike.2009 (Scribe) on May 14, 2011 at 14:16 UTC | |
by Anonymous Monk on May 14, 2011 at 14:24 UTC | |
Re: pp module messes encoding
by Anonymous Monk on May 14, 2011 at 14:10 UTC |
Back to
Seekers of Perl Wisdom