Cody Pendant has asked for the wisdom of the Perl Monks concerning the following question:

I'm a bit puzzled by this one, but I bet the answer's obvious.

I write a perl script and turn it into a Windows executable, using pp on a PC with ActiveState Perl and all the right modules.

Then I test it. It works fine. Does it work fine on another PC without Perl and half of CPAN on it?

My testing normally involves moving it to another, more benighted PC, but there's got to be a smarter way!

How can I test it on the same PC? Empty out @INC somehow?



($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print

Replies are listed 'Best First'.
Re: Testing standalones on PC with Perl
by reneeb (Chaplain) on Feb 03, 2006 at 09:47 UTC
    @INC is not the only "Problem". Sometimes the executable needs some .dlls that you have, but that is not on a standard PC. These .dlls are often in C:\WINDOWS\system32 and if you "empty out" @INC, the application will always find the needed .dlls on your PC, but not on an other PC.

    If a .dll is needed depends on the moduls used in your script.

    The best way to test it is to have to different PCs (one development and one "standard") or to run two different OS on one PC...
Re: Testing standalones on PC with Perl
by marto (Cardinal) on Feb 03, 2006 at 09:27 UTC
    Cody Pendant,

    'Does it work fine on another PC without Perl and half of CPAN on it? '

    Did you read the documentation to find out how to package the modules (along with their dependencies) your script uses?

    Martin
Re: Testing standalones on PC with Perl
by glasswalk3r (Friar) on Feb 03, 2006 at 13:52 UTC

    You can do that if you have some virtualization application like Vmware... but probably it will be more expensive than having another box with MS Windows installed.

    I never tried, but you may try to change PATH variable (and probably @INC too) using a command prompt session to test and restoring it after testing. You could do the same with DLL (like renaming, moving or unregistering it before testing).

    Alceu Rodrigues de Freitas Junior
    ---------------------------------
    "You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill