Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^4: print-screen without non-core modules ?

by palkia (Monk)
on May 28, 2012 at 05:12 UTC ( [id://972778]=note: print w/replies, xml ) Need Help??


in reply to Re^3: print-screen without non-core modules ?
in thread print-screen without non-core modules ?

I can't say exactly because I don't fully understand it myself.
It seem to experience no fundamental run errors but something messes up (what seems to me to be) the encoding.
Try this shot code for example, and see the difference between it's pl and it's exe (pp) versions.
Note that it contains hebrew characters.
use strict; use diagnostics; use warnings; use WWW::Mechanize 'new'; my $mech = WWW::Mechanize->new(); $mech->get( 'http://tv.walla.co.il/?w=/2//353//2011-10-22/1' ); $mech = $mech->content( format => 'text' ); writeFile('del at will.txt',$mech); system('del at will.txt'); exit; sub writeFile { my $filepath = shift; my $nwntnt = join("",@_); $nwntnt = "\x{feff}".$nwntnt; #utf8 char starter no warnings; do { open(TXT, ">:utf8",$filepath); #open(txt, ">",$filepath); print TXT $nwntnt; close TXT; if($! and ($! ne 'No such file or directory') and ($! ne 'Bad file descriptor') ) { print 'Error writing to file: '.$!."\a\nPath: $filepath\nhit the + enter to continue"; <>; } else{$! = '';} } while($!); }
The extreme difference in length alone is unmistakeable,
even if your computer doesn't support hebrew.

Replies are listed 'Best First'.
Re^5: print-screen without non-core modules ?
by marto (Cardinal) on May 28, 2012 at 08:32 UTC

    Well, you did show us the code in question but didn't show us how you used pp to package it, however I'm not sure what your expectations are regarding the size of the executable generated. If you unzip the executable you can see everything which gets bundled up inside the package, the modules you use, their dependencies, the core modules, perl shared libs and so on. See The resulting files are huge! How can I reduce the size of the output file? from the PAR FAQ, and also PAR::Tutorial.

      I used pp by entrering "pp mechanisePpTest.pl" (& nothing else) in my terminal.
      Technically it seems to have all functions operational but the return value is very different

      When I referred to "length" it was the length of the string returned by the code,
      not the size of the pl & exe files.

      Hope that helps ^^

        Yup, you forgot to use the -x or -c option

        pp -x ...

Re^5: print-screen without non-core modules ?
by Anonymous Monk on May 28, 2012 at 05:38 UTC

    You probably forgot to use the -x option (or -c option)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://972778]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-20 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found