Convert Perl+shell script to EXE

923 views Asked by At

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

There are 2 answers

2
Demnogonis On

Take a look at PAR::Packer

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

0
tjd On

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.