Perl Dev Kit

Restoring the native Perl debugger on 32 bit systems

Question: 

How do I switch back to using the native Perl command line debugger?

Answer: 

When the Perl Dev Kit is installed, the PDK's Graphical Debugger becomes the default debugger, replacing the console debugger included with your Perl distribution.

To disable the Graphical Debugger included with the Perl Dev Kit and use the console debugger instead, perform the following steps:

  1. Ensure that the Graphical Debugger is set to remote mode.
    • On the command line, enter pdkdebug --query to view the current mode.
    • If necessary, enter pdkdebug --remote to set the debug listener to local mode.
  2. Set the debugger to the console debugger included with Perl 5.x. On the command line, enter:
        set PERLDB_OPTS=

To disable the Graphical Debugger permanently, remove the PERL5DB key from HKEY_LOCAL_MACHINE\SOFTWARE\Perl and remove the PERLDB_OPTS system environment variable.

Distributing PerlRt.dll with your PerlNet component

Question: 

What do I need to deploy with my PerlNET component?

Answer: 

PerlNET components built with the --freestanding option are not completely freestanding; you also need to deploy perl56.dll (or perl58.dll), perlnh.dll and perlrt.dll.

PerlNH60.dll can be found in the PDK bin directory (usually C:\Perl\bin directory or C:\Program Files\ActiveState Perl Dev Kit 6.0\bin.

PerlRT60.dll is more difficult to find because it is moved to the .NET Global Assembly Cache during installation of the PDK. Copy it out of the GAC by opening a DOS prompt and changing to the PerlRT60 directory:

  c:\> cd c:\WINDOWS\assembly\GAC\PerlRT60\

This directory should contain only one subfolder. Use 'dir' to find the name. For example:

  6.0.2.6772__cea8284aa6739163

Copy the .dll from this folder like this:

  C:\WINDOWS\assembly\GAC\PerlRT>copy 6.0.2.6772__cea8284aa6739163\perlrt60.dll c:\tmp

Note: On Windows 2000 and NT systems, the WINDOWS directory will be called WINNT. With previous versions of the PDK, the DLL filenames do not contain a version numbers (i.e. PerlRT.dll and PerlNH.dll)

Does PerlApp provide Code Obfuscation?

Question: 

Will people be able to decompile the executables I've made with PerlApp?

Answer: 

PerlApp does provide a degree of code obfuscation. There is no trivial method to unwrap a PerlApp file.

Reverse Engineering any executable is possible if the attacker has control of the hardware. Critical copyrighted data and algorithms should be protected by a suitable legal agreement or not included in Perl code within a PerlApp file. If you are concerned about keeping important parts of your code secret, you may want to consider some additional measures, such as:

  • using strong encryption for critical data
  • implementing critical algorithms as XS modules that can be used by your Perl code.

Suppress console windows when using backticks

Question: 

How do I stop console windows from popping up when i call commands in backticks?

Answer: 

Using perlapp's --gui option should hide normal perl command line output, but system commands called within backticks may still open command line windows. To suppress this, try adding the following block to your script:

BEGIN {
    Win32::SetChildShowWindow(0) if defined &Win32::SetChildShowWindow;
}

This should work using ActivePerl version 632 or later.

Upgrade error - version mismatch.

Question: 

I'm getting the error "Perl lib version () doesn't match
executable version ()". What's wrong?

Answer: 

If you recieve an error that looks like the following:

"Perl lib version (v5.8.3) doesn't match executable version (v5.8.4) at
/PerlApp/Config.pm line 32.
BEGIN failed--compilation aborted at perlapp.pl line 859."

It's possible that you've installed a recent version of the PDK without first uninstalling the older version. This is not recommended.

To correct the problem:

  • Uninstall all versions of the PDK
  • Ensure the PDK installation directory has been removed. If necessary, delete it manually
  • reinstall the latest version of the PDK

Batch file for switching to/from PDK Debugger

Question: 

How can I quickly switch between using the PDK Debugger and the command
line debugger?

Answer: 

Here is a batch file for manipulating the relevant environment variables:

@ECHO OFF
SET MODE=%1

IF "%MODE%" == "PDK" GOTO PDK
IF "%MODE%" == "CLI" GOTO CLI
ECHO "no valid input? usage: DBSET "
ECHO "possible modes PDK or CLI"
GOTO END

:PDK
SET PERL5LIB=C:\Program Files\ActiveState Perl Dev Kit 6.0\lib\
SET PERL5DB=
GOTO REPORT

:CLI
SET PERL5LIB=""
SET PERL5DB=BEGIN { require 'perl5db.pl'; }
GOTO REPORT

:REPORT
ECHO Debugger mode set to %MODE%

:END

Copy the code into a file called DBSET.BAT, and move it into a directory in your PATH (e.g. C:\Perl\bin).

To use perl's regular command line debugger:

C:\> DBSET CLI

To use the PDK Debugger:

C:\> DBSET PDK

Perl Dev Kit blurb

Are you serious about programming in Perl? The Perl Dev Kit is a collection of useful tools that would benefit any Perl developer. Create stand-alone executables with PerlApp, debug Perl scripts locally or on a remote server with the graphical Debugger, improve code performance and reliability with PerlCov, or create complex text filters visually using Filter Builder.

Quick Links: