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

Hi I'm trying to get some old Perl scripts written for a Solaris Unix server to work on a windows server. The installation seemed to go fine but I'm having trouble locating a module. Using ppm I can find the Mail::Sender module in a local repository but when I try and compile/run my code it comes up unable to find Mail::Sender.
ppm> install mail::sender Searching for 'mail::sender' returned multiple results. Using 'search' + instead.. . Searching in Active Repositories 1. Mail-Sender [0.8.13] Send mails with attachments through a S +MTP serv~ 2. Mail-Sender-Easy [v0.0.5] Super Easy to use simplified interface +to Mail:~ ppm> 1 Unknown command '1'; type 'help' for a list of commands. ppm> uninstall mail::sender Error: package 'mail::sender' is not installed. ppm> uninstall Mail::Sender Error: package 'Mail::Sender' is not installed. ppm> install Mail::Sender Searching for 'Mail::Sender' returned multiple results. Using 'search' + instead.. . Searching in Active Repositories 1. Mail-Sender [0.8.13] Send mails with attachments through a S +MTP serv~ 2. Mail-Sender-Easy [v0.0.5] Super Easy to use simplified interface +to Mail:~ ppm> q C:\Perl\bin>cd ../../scripts C:\scripts>cr_trans_sh.pl Can't locate Mail/Sender.pm in @INC (@INC contains: /home/interface/se +ctran/lib /home/interface/scripts/Perl_Modules C:/Perl/lib C:/Perl/site/lib .) a +t C:\scrip ts\cr_trans_sh.pl line 14. BEGIN failed--compilation aborted at C:\scripts\cr_trans_sh.pl line 14 +.

The only change to the script was the first line indicating where Perl is loaded from - was #!/usr/bin/Perl and is now just #!Perl.
The begining of my script is
#!perl -c # ############################################################### # Extra Modules should be declared here. # # All these modules MUST be found on the server attempting to # # call this script. # ############################################################### # use strict ; # Enforce private + variables use lib '/home/interface/scripts/Perl_Modules' ; # Where ACC_Vario +us lives use lib '/home/interface/sectran/lib' ; # Where SECTRAN l +ives use sectran ; # In-House FTP Pe +rl Module use Cwd ; # Current Working + Directory Module use Mail::Sender; # Email module #

I suspect I'm missing something obvious but I can't see it. Anyone know what mistake I've made?
Cheers

Replies are listed 'Best First'.
Re: Perl Modules in Windows problem
by ww (Archbishop) on Mar 19, 2008 at 18:18 UTC

    1. The sequence of ppm commands you've shown does not demonstrate that you actually installed Mail::Sender. Try Herkum's suggestion. Even when you got around to using its search in the CLI, you quit without following up.

    2. You changed the shebang, but the use lines still have nix-ish paths. Are you sure that's right (and I ask despite seeing that @INC purportedly includes them)?

    3. There are several excellent tutorials on installing modules here (though, TTBOMK, none that deal specifically with ppm4 if that's what you're using). See
      A guide to installing modules for Win32 and replies and references

          and
      A detailed How-To for locally installing modules

Re: Perl Modules in Windows problem
by Herkum (Parson) on Mar 19, 2008 at 17:10 UTC

    ppm refers to package bundle names rather than the namespace of the package you want to install (unlike CPAN). Try this,

    ppm> install Mail-Sender

    That should work

Re: Perl Modules in Windows problem
by pc88mxer (Vicar) on Mar 19, 2008 at 17:04 UTC
    From reading the ppm faq, it appears you should use:
    install 1
    to install the first listed package.
Re: Perl Modules in Windows problem
by DACONTI (Scribe) on Mar 19, 2008 at 20:31 UTC
    Using ppm I can find the Mail::Sender module in a local repository
    According to your log you were not searching locally but on the net (ppm install starts a search on the network if it doesnt find the module locally).
    To list local perl installed modules you should use the "ppm query"
    Try as well "ppm help"
    Ciao!
    Davide.