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

Hi I hope someone can advice me on my problem
I am working on XP pro, Perl v5.8.8 Binary build 820 by ActiveState.

I had a simple script which I have no problem in using the perl command line interpreter. However when I packaged it into win32 executable using PAR packager(0.975).
pp flhtml.pl -o flhtml.exe

I had the following errors when I run the executable .exe
** Can't call method "replace" on an undefined value at MIME/Lite/HTML.pm line 475.
** Can't call method "send_by_smtp" on an undefined value at script/flhtml.pl

Can someone please help.
Thanks

The email address and smtp GW was changed, else the script is as follows
flhtml.pl
#!/usr/bin/perl -w use strict; use MIME::Lite::HTML; my $mail_HTML = MIME::Lite::HTML->new ( From => 'from@abc.com', To => 'to@xyz.com', Subject => 'Html Mail' ); my $MIMEmail = $mail_HTML->parse('file:///c:\test.htm'); $MIMEmail->send_by_smtp('mail.abc.com');

Replies are listed 'Best First'.
Re: problem with pp packager
by jettero (Monsignor) on May 24, 2007 at 12:25 UTC

    Years and years ago, when I was a big PAR fan, I used to sometimes have to include some modules by hand. Try pp -M MIME::Lite::HTML -M MIME::Lite -v -o flhtml.exe and see if it pulls in the required modules better?

    The dep scanner is probably just missing one of the modules for some reason. Perhaps MIME::Lite::HTML pulls in MIME::Lite in some non-standard way or something. Who knows.

    UPDATE: Looking at MIME/Lite/HTML.pm around line 475, I would guess that it's something more complicated. The function (build_mime_object) appears to build the message and then apply treatments for the various different types of messages. How it gets to the bottom without having $mail filled out is a little mysterious — In particular, why would it differ once packed with pp.

    I still think the manual package deps could help, but it's less likely than I thought.

    -Paul

      I am using Windows XP, ActiveState Perl 5.8.8, build 820.

      In pursuit of duplicating your problem, I attempted to install MIME-Lite-HTML-1.22. Unfortunately it would not pass two of its tests because, as the error message says, "symbolic links are not supported on this system". Consequently this will not install (except perhaps with force). Are you sure this is supposed to work on Windows? How did you get past this?

      I will paste below attempts to run the failing tests one at time.

      C:\DOCUME~1\ALLUSE~1\DOCUME~1\WEBDOW~1\perl\mime\MIME-Lite-HTML-1.22>perl -Mblib t\20create_image_part.t
      ln: symbolic links are not supported on this system
      You said to run 0 tests! You've got to run something.
      # Looks like your test died before it could output anything.

      C:\DOCUME~1\ALLUSE~1\DOCUME~1\WEBDOW~1\perl\mime\MIME-Lite-HTML-1.22>perl -Mblib t\50generic.t
      ln: symbolic links are not supported on this system
      1..0 # Skip Error on link C:/DOCUME~1/ALLUSE~1/DOCUME~1/WEBDOW~1/perl/mime/MIME-Lite-HTML-1.22/t!

Re: problem with pp packager
by xiao_B (Initiate) on May 24, 2007 at 16:57 UTC
    Hi Paul , Thanks for your prompt reply
    pp -M MIME::Lite::HTML -M MIME::Lite -v -o flhtml.exe

    I have tried to include the modules , but it don't seems to work. I am stuck on this for a few days.....

    I even try to comment out the code on line 475
    But I guess , did not get to the root of the problem.

    Any other good suggestions for me.
    I am new to perl.
    Thanks Jim
      Many months later, I revisit my problem and manage to solve myit by packaging the file test.htm in the pacakge. It works fine.