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

My script fails when trying to load the Mail::Internet module with the error: Can't locate Mail/Internet.pm in @INC (@INC contains: /opt/bin/lib /usr/lib/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 /usr/lib/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl .) at verificationparse.pl line 5. BEGIN failed--compilation aborted at verificationparse.pl line 5. Line 5 is <use Mail::Internet>; The problem is that Mail::Internet IS installed. If I do a <perl -MMail::Internet -e1 && echo module found> it responds 'module found' and when I have it echo the version I get the correct version - 2.04 The code works on my Fedora 11 box but not on this SUSE box. Any help appreciated.

Replies are listed 'Best First'.
Re: Module not found
by toolic (Bishop) on Sep 02, 2009 at 18:07 UTC
    It seems like you do not have this module installed on both of your machines. To help debug, add these lines to your verificationparse.pl script. This will show you the actual paths as seen by the script (@INC):
    use Data::Dumper; print Dumper(\@INC); print Dumper(\%INC);

    Also, to see the full path to the module file from your command line:

    perldoc -l Mail::Internet

    Update: Your question would be easier to read if you place your error messages inside 'code' tags: please read Writeup Formatting Tips.

      perldoc -l Mail::Internet returns 'No documentation found...'
      I did not see any output from the print Dumper lines.
      perllocal.pod does have an entry for Mail, actually it has more than one since I have installed it a couple of times. The entry (excerpt) is as below:

      =head2 Wed Sep 2 13:11:10 2009: C<Module> L<Mail|Mail>
      =over 4
      =item *
      C<installed into: /usr/lib/perl5/site_perl/5.8.8>
Re: Module not found
by massa (Hermit) on Sep 02, 2009 at 18:54 UTC
    Doesn't F11 ship with perl5.10 ? If so, your Mail::Internet is installed for 5.10 and not for 5.8 (which is what you need on SuSE :-D)... verify also if the script doesn't have a #!/usr/bin/perl5.8 shebang line...
    []s, HTH, Massa (κς,πμ,πλ)
      i did download and install the Mail::Internet module so i'm at a loss as to why it is not found. my shebang is #!/usr/bin/perl is that correct or should it point to perl5.8.8?

        Whichever one you used to install Mail::Internet.

        Or conversely, you need to install Mail::Internet using for whichever perl you want to use.

        What does perl -V says? and which perl ?
        []s, HTH, Massa (κς,πμ,πλ)
Re: Module not found
by Anonymous Monk on Sep 03, 2009 at 18:52 UTC
    I went back and removed all entries of the Mail::Internet module from perllocal.pod, deleted the directory containing the installed module, deleted the module install directory and started from scratch installing the module and it now works. I'm thinking that MakeFile does not overwrite the files it creates when it runs so it had the information in it when I was getting an error about makefile not knowing what LICENSE was. I had ignored the error at first and went ahead and installed the module. I later went back and loaded the module to correct the issue and re-installed Mail::Internet but I'm guessing that it didn't really install over the original install.

    Thanks to all of those who replied to my post, it got me thinking in the right direction.