0

I have a perl script which calls for shell commands, this runs in cygwin.

Ex

cat a.txt | egrep $a

Currently I required to convert this to EXE and run win 7. I used perl2exe to convert this works well on cygwin installed. This doesnt work without cygwin installed.

Is there any way to convert the script to exe and runs without help of cygwin.

Thanks in advance

2 Answers2

2

Your problem is that both perl2exe & PAR::Packer will wrap up the perl stuff but won't (by default) wrap up your bash shell & faux linux environment all into one little .exe file. You might be able to force it to swallow the cygwin.dll + bash.exe + cat.exe + egrep.exe and combine them into a runnable whole. Good luck with that endeavor.

As an alternative have you considered reading the file yourself (to replace the functionality of cat) and sending it's contents either to

  1. a windows specific (not cygwin) port of egrep (only 1 additional .exe as opposed to 3)
  2. implementing in perl the subset of egrep's functionality that you require.
tjd
  • 4,064
  • 1
  • 24
  • 34
0

Take a look at PAR::Packer

It packs the Perl interpreter and all required modules into an executable package.

Demnogonis
  • 3,172
  • 5
  • 31
  • 45
  • I am facing below error when I tried Par:packer PAR::StrippedPARL::Static->get_raw() did not return the raw binary data for a PAR loader at /usr/lib/perl5/site_perl/5.14/PAR/StrippedPARL/Base.pm line 141, line 1. Could not write temporary parl (class PAR::StrippedPARL::Static) to file '/tmp/parlC6wJ.exe' at /usr/lib/perl5/site_perl/5.14/PAR/StrippedPARL/Base.pm line 65, line 1. /usr/local/bin/pp: Failed to extract a parl from 'PAR::StrippedPARL::Static' to file 'parl1vISXfW.exe' at /usr/lib/perl5/site_perl/5.14/PAR/Packer.pm line 1171, line 1. – user2310223 Apr 23 '13 at 12:10
  • Hm... I never tried cygwin perl. Are you bound to cygwin? If not try it with [strawberry](http://strawberryperl.com/) perl. It works pretty good on windows machines and PAR::Packer installs without any problems on my win7x64 with strawberryperl 5.14 – Demnogonis Apr 23 '13 at 13:13