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

I am a beginner in Perl.I was trying to convert some Perl scripts into Perl exe files using pp utility (Ex:pp -o test.exe test.pl). I have succeeded in few exe files creation.Recently I packed a script into exe file which is throwing an error

DBD::AnyData::st execute failed: Execution ERROR: Error Opening File-Parser: Can't Locate AnyData/Format/Pipe.pm in @INC <@INC contains......

I have installed these modules in my system.The Script is running fine as expected but when packed into exe file,it is not working. Please find below my Script
use DBI; use strict; use DBI::DBD::SqlEngine; use AnyData; use DBD::AnyData; unlink "QueryResult.txt"; print "\nEnter the input file name with path info : \n"; chomp( my $dir = <STDIN>); my ($directory,$file_name); if($dir=~m/(.*\\)([^\\]+)$/is) { $directory=$1; $file_name=$2; $file_name=~s/\.[^>]*$//igs; } $dir =~ s!\\!\/!igs; print "\nEnter the file delimiter(Pipe,CSV,Tab) : \n"; chomp( my $deli = <STDIN>); print "\nDo you want to count the number of lines in the input file(1= +Yes,0=No) \n"; chomp( my $depend_flag = <STDIN>); if($depend_flag==1) { open(IN,"$dir"); my @str = <IN>; close(IN); my $lines=scalar(@str); print "The number of lines in $dir is $lines.\n"; } query: print "\nEnter the query to execute : \n"; chomp( my $query = <STDIN>); my $dbh = DBI->connect('dbi:AnyData:'); $dbh->func( "$file_name", "$deli", "$dir",'ad_catalog'); my $sth = $dbh->prepare("$query"); $sth->execute(); print "\n"; while (my $row = $sth->fetch) { print "@$row\n"; open(APPEND,">>$directory/QueryResult.txt"); print APPEND "@$row\n"; close(APPEND); } print "\nDo you want to execute another query(1=Yes,0=No) \n"; chomp( my $flag = <STDIN>); if($flag==1) { goto query; } else { exit; }
My doubt was whether Module::ScanDeps. module in pp utility is listing all the dependent modules in Anydata.pm to pack. I tried adding this module also while packing(Ex: pp -o test.exe -M AnyData test.pl).But it failed

Please help me on this. Thanks in Advance.

Replies are listed 'Best First'.
Re: Help needed in Perl exe creation
by marto (Cardinal) on Dec 14, 2011 at 09:58 UTC

    Which version of pp are you using? Have you tried adding AnyData::Format::Pipe directly? pp -o test.exe -M AnyData -M AnyData::Format::Pipe test.pl

      You are great..Thanks a lot.. It worked..
Re: Help needed in Perl exe creation
by Anonymous Monk on Dec 14, 2011 at 10:25 UTC