in reply to Perl Executables

The modules may not have been entirely needed. One of the things that I have been forced by necessity to do is tell Perl exactly which functionality I need from each module. Now, this isn't all that easy to do with dependencies, but it beats loading the entire POSIX module into the EXE.

As best as I can understand it, when you execute a perl script, or compile it to byte code, the engine pulls in all of the modules that are declared. If you don't want to pull them all in, you need to use something like: use POSIX qw(:errno_h); That *should* fix the problem you have of the executables being large. Hopefully someone else will have better input than I do. :)

Replies are listed 'Best First'.
Re: Re: Perl Executables
by cmilfo (Hermit) on Feb 01, 2002 at 15:49 UTC
    Correct me if I'm wrong (this happens frequently), but doesn't the use MODULE qw(:method) only work if the module exports the method? I've tried to limit my .exe's before, be it only works on certain methods in certain modules.

    And, I've not used Perl2exe as extensively as I've used ActiveState's PerlSvc and PerlApp (from Perl Dev Kit). Limiting the imported methods does not help as the modules are typically included as .dll's. So, while I might only use two methods from Win32::Process, it includes the entire Win32/Process/Process.dll. There is an option to exclude the .dll's from the compile, thus making the .exe smaller, but the .dll's must be installed on the target machine to do so. You might look for similar functionality in Perl2exe.