in reply to Problem running Sample code in Strawberry perl

As with your previous post on installing with ppm you need to know how to use the tool in question:

cpan> install Win32::GuiTest

Note that Perl is case sensitive. See Installing Modules

To run a script do:

C:\perl TestScriptName.pl

From the command line, where TestScriptName.pl is the one you want to run.

You should read and understand Installing Modules from the tutorials section of this site. You may also want to do some more reading there regaring the basics in that area, see also http://learn.perl.org/

Hope this helps

Martin

Replies are listed 'Best First'.
Re^2: Problem running Sample code in Strawberry perl
by rohn (Initiate) on Sep 15, 2009 at 12:34 UTC

    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.

      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.