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


Hi Gurus,
I am trying to create a freestanding executable in Windows using PerlApp - 5.2.0 build 520 and perl 5.8.3. The script contains the following lines:
use strict; use LWP::UserAgent; while(1) { sleep 2; }

The command line used to create the executable is:

Perlapp --verbose test.pl


This gives the following verbose output on compilation:
PerlApp 5.2.0 build 520 Copyright (C) 1998-2003 ActiveState Corp. All rights reserved. +++ c:\Schrodinger-perl\lib\AutoLoader.pm +++ c:\Schrodinger-perl\lib\Carp.pm +++ c:\Schrodinger-perl\lib\Carp\Heavy.pm +++ c:\Schrodinger-perl\lib\Config.pm +++ DynaLoader.pm (internal) +++ c:\Schrodinger-perl\lib\Errno.pm +++ c:\Schrodinger-perl\lib\Exporter.pm +++ c:\Schrodinger-perl\lib\Exporter\Heavy.pm +++ c:\Schrodinger-perl\lib\File\Glob.pm +++ c:\Schrodinger-perl\site\lib\LWP\UserAgent.pm Mac\FileSpec\Unixish.pm: warn: Can't locate Mac\FileSpec\Unixish.pm refby: c:\Schrodinger-perl\lib\DynaLoader.pm +++ c:\Schrodinger-perl\lib\Term\Cap.pm +++ c:\Schrodinger-perl\lib\Text\ParseWords.pm +++ XSLoader.pm (internal) +++ c:\Schrodinger-perl\lib\attributes.pm +++ c:\Schrodinger-perl\lib\auto\DynaLoader\autosplit.ix +++ c:\Schrodinger-perl\lib\auto\DynaLoader\dl_expandspec.al +++ c:\Schrodinger-perl\lib\auto\DynaLoader\dl_find_symbol_anywhere.al +++ c:\Schrodinger-perl\lib\auto\DynaLoader\dl_findfile.al +++ c:\Schrodinger-perl\lib\auto\File\Glob\Glob.dll +++ c:\Schrodinger-perl\lib\auto\re\re.dll +++ c:\Schrodinger-perl\lib\re.pm +++ c:\Schrodinger-perl\lib\strict.pm +++ c:\Schrodinger-perl\lib\vars.pm +++ c:\Schrodinger-perl\lib\warnings.pm +++ c:\Schrodinger-perl\lib\warnings\register.pm +++ perl58.dll (c:\Schrodinger-perl\bin\perl58.dll) Please run `perlapp.exe --help DIAGNOSTICS` for more information about the generated error and warning messages. Created 'test.exe'

On running the executable, I end up in following error:
/PerlApp/strict.pm did not return a true value. BEGIN failed--compilation aborted at test.pl line 1.

Can anyone comment what can be the reason for this problem? If I remove the pod line from LWP::UserAgent ( =head1 NAME..... ), the executable works fine. What's the mystery behind this?


I am giving here the output of Perl -V's @INC for reference:
@INC: c:/Schrodinger-perl/lib c:/Schrodinger-perl/site/lib

Replies are listed 'Best First'.
Re: PerlApp Error - /PerlApp/strict.pm did not return a true value.
by syphilis (Archbishop) on May 26, 2008 at 07:39 UTC
    That's pretty weird. Does the script runs ok as a perl script ? (I'm assuming it does.)

    Assuming it's version 1.03 of strict.pm, does it make any difference if, in strict.pm, you change:
    1; __END__
    to:
    1; __END__
    (That is, insert an empty line between the "1;" and the "__END__".)
    Other than that, if you don't find the answer here, you should try posting to ActiveState's PDK mailing list.

    Cheers,
    Rob
      Hi Rob,

      Thanks for the reply. The code runs fine as a perl script but as perlapp executable it throws the above error.

      Useragent.pm and strict.pm contains only the following code ( modified to find the actual problem ):

      UserAgent.pm package LWP::UserAgent; 1; =pod =head1 NAME LWP::UserAgent - Uniform Resource Locators =head1 SYNOPSIS $u1 = LWP::UserAgent->new($str, $base); $u2 = $u1->abs; =cut
      strict.pm 1;

      If we remove the pod lines from UserAgent.pm, the executable works fine. Really wierd seeing this behavior. I have posted in Active State's PDK forum, still need to hear a reply from them. Any clue from the following code where the problem lies?

      -Karthik

        Is there really a space before =cut in UserAgent.pm? If so, remove it -- it's possible that Perl thinks that your strict is all POD.