Find the answer to your Linux question:
Results 1 to 5 of 5
Hi all, I am new in Perl language. I wrote a perl script to send an email notification to users by using: use MIME::Lite; However, i get the error: Can't ...
  1. #1
    Just Joined!
    Join Date
    Nov 2009
    Posts
    9

    [Solved] Can't locate MIME::Lite.pm in @INC

    Hi all,

    I am new in Perl language. I wrote a perl script to send an email notification to users by using:

    use MIME::Lite;

    However, i get the error:
    Can't locate MIME Lite.pm in @INC(@INC contains: /usr/lib/perl5/5.10.0/i386-linux-thread-multi /usr/lib/perl5/5.10.0 /usr/local/lib/perl5/site_perl/5.10.0/i386-linux-thread-multi /usr/local/lib/perl5/site_perl/5.10.0 /usr/lib/perl5/vendor_perl/5.10.0/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.0 /usr/lib/perl5/vendor_perl /usr/local/lib/perl5/site_perl .) at email.pl line 5.
    BEGIN failed--compilation aborted at email.pl line 5.

    Below is the simplify version for my code. What 's wrong with my coding?

    Code:
    my $message = MIME::Lite->new(
    To => 'xxx@mail.com',
    Subject => 'message',
    Data => 'Message body'
    );
    $message->send();

  2. #2
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    You might not have installed MIME::Lite yet.

    In a shell enter:
    cpan MIME::Lite
    And try to rerun your script =)
    New Users, please read this..
    Google first, then ask..

  3. #3
    Just Joined!
    Join Date
    Nov 2009
    Posts
    9
    I entered
    Code:
    cpan MIME::Lite
    but i get:
    bash: cpan: command not found

  4. #4
    Just Joined!
    Join Date
    Nov 2009
    Posts
    9
    The error is fixed after i installed the MIME::Lite module.

    Download the MIME::Lite module.
    Install the module as follows:

    perl Makefile.PL
    make
    make test
    make install

  5. #5
    Linux Engineer RobinVossen's Avatar
    Join Date
    Aug 2007
    Location
    The Netherlands
    Posts
    1,422
    thats manual.. but its fine
    you can see CPAN as a packagemanger for your perl. (eg, yum, apt, ebuild or pacman)
    New Users, please read this..
    Google first, then ask..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...