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

Hi, After several attempts at using the PAR packager to package my modules i am facing some problems. Here are few details about what i am trying to do.

I have installed strawberry-perl-5.12.3.0 and i have downloaded few modules from CPAN which are present in my C:\strawberry\perl\site\lib directory.

I have few perl scripts which i have written based on the modules i have downloaded.

Now i have to package all my scripts and the modules those are present at C:\strawberry\perl\site\lib so i am creating a PAR file, until here everything works fine. I am using the below command to add my modules and scripts in to the PAR and all the modules are added fine and generate a file called 'a.par'.

pp -a C:\strawberry\perl\site\lib -B -p D:\ABD\PerlProjects\Sample\Balaji\Test.pl

Now inorder to test it i am using a fresh machine where i installed strawberry perl and wrote a small program to import these modules and check if it works. Below is my program. In the program i am using Win32::GuiTest which is part of my PAR file which i want to use.

#!usr/bin/perl use PAR 'a.par' use Win32::Process; use Win32::GuiTest; my $Processobj; Win32::Process::Create($ProcessObj, "C:\\ +Program Files\\ABD\\Application\\App.exe", ".", 0, NORMAL_PRIORITY_CLASS, "C:\\Program Files\\ABD\\Application") +|| die "Could not spawn process";
After this when i run the program i get the below error which i am not able to resolve. Microsoft Windows XP Version 5.1.2600 (C) Copyright 1985-2001 Microsoft Corp. C:\Documents and Settings\buildrelease>d:

D:\>New.pl Can't locate Win32/GuiTest.pm in @INC (@INC contains: a.par CODE(0x9ef4b4) C:/strawberry/perl/site/lib C:/strawberry/perl/vendor/lib C: /strawberry/perl/lib . CODE(0x9d0764)) at D:\New.pl line 5. BEGIN failed--compilation aborted at D:\New.pl line 5.

Can anybody tell me whats wrong with my approach and correct me.

Replies are listed 'Best First'.
Re: Importing modules from a par file fails.
by marto (Cardinal) on Jun 01, 2012 at 08:41 UTC
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Importing modules from a par file fails.
by Anonymous Monk on Jun 01, 2012 at 06:24 UTC
    And where is a.par located? Try using absolute paths
      I have added a.par to C:\strawberry\perl\site\lib ,since it is one of the inc paths. Should i add alongside my script location?

        I have added a.par to C:\strawberry\perl\site\lib ,since it is one of the inc paths. Should i add alongside my script location?

        Why did you do that?

        Why don't you simply try a full path?