NAME

Win32::PerlExe::Env - Get environment informations of Win32 Perl executables

VERSION

This documentation refers to Win32::PerlExe::Env Version 0.02.05 $Revision: 486 $

Precautions: Alpha Release.

SYNOPSYS

:DEFAULT
use Win32::PerlExe::Env;
$dir  = get_tmpdir();
$dir  = get_tmpdir( 'Copyright' );
:tmp
use Win32::PerlExe::Env qw(:tmp);
$dir  = get_tmpdir();
$file = get_filename();
:vars
use Win32::PerlExe::Env qw(:vars);
my @vars =
    ( map {&$_} qw(get_build get_perl5lib get_runlib get_tool get_version) );
:all
use Win32::PerlExe::Env qw(:all);
%vars = (
    map { uc $_ => eval "&get_$_" }
        map {lc} qw(tmpdir filename BUILD PERL5LIB RUNLIB TOOL VERSION)
);

DESCRIPTION

Win32::PerlExe::Env provides special 'build-in' environment informations of Perl .exe files.

The main goal of this module version is to receive the internal temporary directory of packed Perl executables regardless of the used packer.

Additional packer specific environment informations like version, packername, etc. will be supported.

This version assists ActiveState PDK packers.

EXPORT

:DEFAULT
get_tmpdir
:tmp
get_tmpdir get_filename
:vars
get_build get_perl5lib get_runlib get_tool get_version
:all
get_tmpdir get_filename get_build get_perl5lib get_runlib get_tool get_version

FUNCTIONS

  • get_tmpdir()

  • get_tmpdir(filename)

    Get internal temporary working directory of executable.

    Hint for ActiveState PDK packer: The returned internal temporary working directory will exist only if any packed file was extracted automactically or explicitly "SEE ALSO". Therefore it is strongly recommended to test the existence of the returned directory (-d) before usage.

  • get_filename()

  • get_filename(filename)

    Get internal temporary filename of executable.

    Security hint for ActiveState packer: As a side effect the given file will be extracted into internal temporary working directory "SEE ALSO".

  • get_build

    Get the packers build number.

  • get_perl5lib

    Get the PERL5LIB environment variable. If that does not exist, it contains the value of the PERLLIB environment variable. If that one does not exists either, result is undef.

  • get_runlib

    Get the fully qualified path name to the runtime library directory.

    ActiveState specifies this by the --runlib option. If the --norunlib option is used, this variable is undef.

  • get_tool

    Get string PerlApp|PerlSvc|PerlTray ..., indicating that the currently running executable has been produced by this packer (=tool).

  • get_version

    Get the packers version number: 'major.minor.release', but not including the build number.

DIAGNOSTICS

Running this module as part of a normal script (.pl) 'undef' results will be returned.

CONFIGURATION AND ENVIRONMENT

[PDK] BOUND FILES

ActiveState PDK only:

Bound files are additional files to be included in the executable which can be extracted to an internal temporary directory or can be read directly like normal files.

Win32::PerlExe::Env supports different strategies to find out the internal temporary directory because basically inofficial PDK functions are used.

To get a stable configuration under all circumstances it is recommended that the PDK configuration files (*.perlapp, *.perlsvc or *.perltray) contain one of the following entries to define an internal default bound file:

Bind: Win32[data=Win32]
Bind: PerlExe[data=PerlExe]
Bind: Env[data=Env]

These 'identifiers' will be tested internally as defaults. See EXAMPLE.

Alternatively the default bound file can be omitted if one or more user bound files were bound into the executable instead, e. g.

Bind: Get_Info.ico[file=res\icons\Get_Info.ico] and/or
Bind: Copyright[data=Copyright (c) 2006 Thomas Walloschke.]

This means the ':tmp' functions can be called with one of these filenames:

get_filename( 'Get_Info.ico' );
get_tmpdir( 'Copyright' );

EXAMPLE

See source file exe/Win32-PerlExe-Env.pl, packer configuration file exe/Win32-PerlExe-Env.perlapp and test executable files exe/Win32-PerlExe-Env.exe and exe/Win32-PerlExe-Env.bat of this distribution.

DEPENDENCIES

An advantageous Win32 PerlExe Packer like Perl Development Kit [PDK].

BUGS

This version examines 'ActiveState PDK executables' only (PerlApp, PerlSvc and PerlTray).

Win32::PerlExe::Env was tested only with MS Windows XP Professional (5.1.2600 Service Pack 2) and ActiveState PDK 6.0.2.

Send bug reports to my email address or use the CPAN RT system.

SEE ALSO

Perl Development Kit [PDK] http://www.activestate.com/Products/Perl_Dev_Kit/?mp=1

AUTHOR

Thomas Walloschke <thw@cpan.org>.

COPYRIGHT AND LICENSE

Copyright (c) 2006 Thomas Walloschke (thw@cpan.org). All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.

DATE

Last changed $Date: 2006-09-09 20:48:00 +0200 (Sa, 09 Sep 2006) $.