in reply to Re: Problem running Sample code in Strawberry perl
in thread Problem running Sample code in Strawberry perl

Thanks Martin for the helo

One Question

Can we load ActiveState Perl & StrawberryPerl on same machine

If yes then is my compiler getting confused as I have loaded both on same machine,

On the CSPAN Client --> of Strawberry perl I typed the below command the output is given below, I think Strawberry perl is recognising the perl

cpan> install Win32::GuiTest Going to read 'C:\Perl\cpan\Metadata' Database was generated on Sun, 13 Sep 2009 10:27:12 GMT Win32::GuiTest is up to date (1.56).

But when I open the Command prompt window and try to RUN the Calc.pl program it gives ERROR

perl calc.pl Can't locate loadable object for module Win32::GuiTest in @INC (@INC c +ontains: C :/Perl/site/lib C:/Perl/lib .) at calc.pl line 10 Compilation failed in require at calc.pl line 10. BEGIN failed--compilation aborted at calc.pl line 10.

Now my Question is may be compiler is not able to trace the Strawberry Perl from command prompt so shall I uninstall Active Perl from my machine may be that solves the issue.

Replies are listed 'Best First'.
Re^3: Problem running Sample code in Strawberry perl
by marto (Cardinal) on Sep 15, 2009 at 12:48 UTC

    Ok, it looks like you are using Strawberry Perl to install Win32::GuiTest then trying to run one of the example scripts using ActiveState Perl.

    From the command line perl -V will give you details about which version of Perl is being run. Strawberry Perl is installed to c:\strawberry by default IIRC. You need to address that issue but I think you already had a long discusion about this topic in the ChatterBox yesterday.

    I can't advise on uninstalling ActiveState Perl from your machine, because I don't know your reasons for having both versions installed.

    Martin

      I think when launching Perl, it's best to either set up $ENV{PATH} so that only one perl.exe is found, or to be (very) explicit in specifying which perl.exe to use.

      For example the following will always launch Strawberry Perl:

      c:\strawberry\perl\bin\perl.exe myscript.pl

      Personally, I have a file path.cmd in each directory containing a Perl installation, which sets up $ENV{PATH} so that only the perl.exe below it is found:

      @echo off SET BASE=%~dp0 path %BASE%\perl\bin;%BASE%\mingw\bin;%BASE%\dmake\bin;%PATH%

      Thanks Martin for the help

      After uninstalling the Active perl now when I run the calc.pl it gives same error

      C:\Documents and Settings\admin\Desktop>perl calc.pl Can't locate loadable object for module Win32::GuiTest in @INC (@INC c +ontains: C :/strawberry/perl/lib C:/strawberry/perl/site/lib .) at calc.pl line 1 Compilation failed in require at calc.pl line 1. BEGIN failed--compilation aborted at calc.pl line 1.

      I think Active perl and strawberry perl both are not getting the path of Win32::GuiTest module ?

      The problem was solved by following Martin and corion suggestions thanks all for the help.
        I think Active perl and strawberry perl both are not getting the path of Win32::GuiTest module ?

        Where did you install it? or Why do you think it is installed?