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

Hi Monks,

Nice day!!I am running this code in Activeperl 5.8,I have the following piece of code,
#!/bin/perl-w use DateTime; print"Hello world\n";
When i run the above code in .pl file,it is working fine.But when i converted it to exe file by using par module and running the exe file,it is showing the message that en_US.pm moudle not found as shown below,
C:\Perl\bin>perdate.exe Can't locate DateTime/Locale/en_US.pm in @INC (@INC contains: CODE(0xd +facec) C:\ DOCUME~1\regan\LOCALS~1\Temp\par-regan\cache-1154325548/inc/lib C:\DOC +UME~1\rega n\LOCALS~1\Temp\par-regan\cache-1154325548/inc CODE(0xceaa3c) .) at (e +val 14) li ne 3. Compilation failed in require at script/perdate.pl line 2. BEGIN failed--compilation aborted at script/perdate.pl line 2.
Could anyone explain me why its behaviour changes when converted to exe file.Also when i tried to install the en_US module by using ppm,i found the following error
C:\Perl\bin>ppm install en_US Error: Failed to download URL http://www.soulcage.net/ppds.58/en_US.pp +d: 404 No Found
I googled it to found in other site,Quite not found anywhere.Pls help me to solve this issue??

Replies are listed 'Best First'.
Re: Why behaviour changes after converting to exe
by reneeb (Chaplain) on Jul 31, 2006 at 07:28 UTC
    the en_US.pm file is part of the DateTime::Locale distribution. Try to add the module to the PAR archive manually:

    pp -M DateTime::Locale -o script.exe script.pl
      pp -M DateTime::Locale -o script.exe script.pl

      That doesn't work for me ... close, but not quite. I found I had to specifically load DateTime::Locale::en_US:
      pp -M DateTime::Locale::en_US -o script.exe script.pl
      Cheers,
      Rob
      A reply falls below the community's threshold of quality. You may see it by logging in.
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Why behaviour changes after converting to exe
by dirving (Friar) on Jul 31, 2006 at 18:08 UTC
    You may be able to use the -x switch of pp to have it catch these dependencies. Be careful though: because this switch actually runs the program, if the program never terminates or does some destructive operation this might have undesired effects.