Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
pm904757.pl
use strict; use warnings; use feature 'state'; use WWW::Mechanize; use Path::Class qw' file dir '; Main( @ARGV ); exit( 0 ); sub Main { 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' ); my $thisf = file($0)->absolute; my $thisd = $thisf->dir; chdir $thisd or die "Cannot chdir($thisd): $!"; my $out = $thisf->basename; $out = "$out-out.txt"; writeFile( $out,$content); print join ' ', -s $out, $out, "\n"; } sub writeFile #form: writeFile(path,content) { my $filepath = shift; open my($txt), ">:utf8",$filepath or die "Cannot open $filepath : $! +"; print $txt "\x{feff}".join('',@_); close $txt ; }
packing
$ pp pm904757.pl $ a The locale codeset (cp1252) isn't one that perl can decode, stopped at + Encode/Locale.pm line 87. Compilation failed in require at LWP/UserAgent.pm line 976. $ pp -x pm904757.pl $ a 6294 a.exe-out.txt $ perl pm904757.pl 6281 pm904757.pl-out.txt
more runs
$ a 6294 a.exe-out.txt $ perl pm904757.pl 6281 pm904757.pl-out.txt $ a 6294 a.exe-out.txt $ perl pm904757.pl 6325 pm904757.pl-out.txt $ a 6330 a.exe-out.txt $ perl pm904757.pl 6323 pm904757.pl-out.txt $ perl pm904757.pl 6330 pm904757.pl-out.txt

In reply to Re: pp module messes encoding by Anonymous Monk
in thread pp module messes encoding by palkia

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (10)
    As of 2018-11-15 17:26 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My code is most likely broken because:
















      Results (189 votes). Check out past polls.

      Notices?
      • (Sep 10, 2018 at 22:53 UTC) Welcome new users!