Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

perl2exe Evaluation Message Avoider

by larryk (Friar)
on Mar 14, 2002 at 12:57 UTC ( #151654=snippet: print w/ replies, xml ) Need Help??

Description: stick this line in your script. if you already have an END block then put this one above it (see perldoc perlmod as regards LIFOness of END block processing). this is tested with perl2exe v5.03 for Win32 but should work for earlier versions too. I don't know what this'll do for the likes of Win32::GUI scripts but it could fix the crashing bug that I vaguely remember seeing when perl2exe tries to display a GUI evaluation message when the app is closed.
END { kill TERM => $$ } # no perl2exe message ;)
Comment on perl2exe Evaluation Message Avoider
Download Code
•Re: perl2exe Evaluation Message Avoider
by merlyn (Sage) on Mar 14, 2002 at 13:47 UTC
    Well, if that does it, then this would probably be safer:
    END { close STDOUT; close STDERR; }

    But of course this is untested. I think perl2exe is an abomination and a con.

    -- Randal L. Schwartz, Perl hacker

      Could you elaborate please Merlyn? It seems that the various packagers (perl2exe, AS PerlDevKit, etc) could be useful if you're distributing a perl app in a Win32 environment and want to make sure all modules & versions are correct. AFAIK, perl2exe jsut packages up the perl executable & any code/modules that is required. The packagers also do some obfuscation, but it usually appeared to be very simple.

      There was a discussion of this subject on the boston.pm list recently. What I said above is the gist of what I got from the various replies. I'd love to hear more details.

        In short:
        • perl2exe spits in the face of open source, by allowing a developer to apparently "lock up" the source to a tool that he developed standing on the shoulders of the open source with which he is using.
        • perl2exe puts a separate copy of the libs in each binary, so if someone installs 10 binaries, they get 10 copies of Perl plus 10 copies of any common modules.
        • perl2exe bills itself as a "compiler", which to the innocent masses means "faster" (as wrong as we know that is), and so people get it to "speed up their code".
        It's a con and an abomination. And for a price! That's the worst part.

        I'm working on plans to make an open-source version of perl2exe that bundles the source code of everything a program requires into a single source file. If anyone wants to work with me on that, please contact me by email (not by chatterbox msg). This will be a "compiler" in the sense of "bundler".

        -- Randal L. Schwartz, Perl hacker

      Well... the firs one (with kill) notifies that the process was killed, while with the second solution you have to wait for 2 seconds after the program has finished :-)
      I suppose that if you really want to cover that message in a bit more polite way, maybe try something like this:

      END { print "Cleaning up...\n"; close STDOUT; close STDERR; }

      Normal user would think that it really does something and it's not sleeping any way ;-)
      IMHO the best way to avoid original message is to pay for perl2exe - if you really need it.
Re: perl2exe Evaluation Message Avoider
by MZSanford (Curate) on Mar 15, 2002 at 10:50 UTC
    I use :
    END { my ($char); open(F,$0); read(F,$char,1); if ($char ne '#') { dump; } }

    Now, this does break any return codes, but on windows, the dump function does not seem to create any sort of core files, so i find this work pretty well, when working on exe's for myself.
    from the frivolous to the serious

Back to Snippets Section

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2014-07-13 05:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (247 votes), past polls