Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Newbie: Perl script to Windows and Linux executable versions.

Reply
Thread Tools

Newbie: Perl script to Windows and Linux executable versions.

 
 
Harry
Guest
Posts: n/a
 
      09-18-2009
On Sep 18, 9:15*pm, RedGrittyBrick <(E-Mail Removed)>
wrote:
> Harry wrote:
> >> I've tried to install PAR:acker from CPAN. After having successfully
> >> installed all its dependencies manually, I discovered that I couldn't
> >> install PAR:acker itself. I got the message:
> >> * * Can't locate ExtUtils/Embed.pm in @INC ...

>
> Doesn't that mean that you have *not* installed all the dependencies? Or
> at least, not in the right places? Did you install ExtUtils::Embed?
> Isn't that one of the standard modules? What Perl versions are you using

Well the original dependencies reported by cpan program were:
Archive::Zip
Getopt::ArgvFile
Module::ScanDeps
PAR
PAR:ist
I installed them all one by one. Manually. Via cpan. This step was
successful.

> (perl -v)?

I'm using '5.10.0 built for i386-linux-thread-multi' on Fedora 11.

> I'm a bit confused about what you want. Do you want two separate files,
> one for Windows and one for Linux, where each file can be installed
> (how? self installer?) and run without first installing Perl and it's
> normal collection of standard modules? Why? Do you want to avoid
> explicitly installing perl? Is there some reason you can install you
> program but not perl?

Ok, here's what I want to do. I do have Perl installed both on Windows
and Linux development machines.
There is a Perl script that I wrote which I tested that it works fine
on my Windows and Linux boxes.
I want to handover this Perl script to another person (outside
development). This another person could be field personnel, or even a
customer. I don't want my logic to be leaked to anyone outside my
development team. Hence the need to have a binary EXE for Windows and
an ELF for Linux that a non-developer could use without needing to
install Perl on their machines and, more importantly, without knowing
what I'm doing inside. Of course, hackers can reverse engineer logic
from EXE/ELF but I can live with that; I only want to make it
difficult for casual hackers.

 
Reply With Quote
 
 
 
 
Harry
Guest
Posts: n/a
 
      09-18-2009
On Sep 18, 9:14*pm, Jürgen Exner <(E-Mail Removed)> wrote:
> Harry <(E-Mail Removed)> wrote:
> >From my already cross-platform Perl script,
> >1. I want a Windows .EXE file that I could run on a Windows box
> >without any need for a Perl installation.
> >2. Likewise, I should be able to have an ELF for the Linux platform.

>
> Well, if you need binaries, then Perl may not have been the best choice.
> IMO all tools that create self-containd executable from Perl scripts are
> crutches at best and don't work all that well.


Really?! That is very disappointing to hear. I was (and am still)
hoping for a tool that I could point
to my local Perl installation and
to my Perl script, which will then
give me a platform-specific executable (EXE or ELF).

Basically, what you're saying is commercial programs like Perl2Exe
don't fully work! Do you have any info on what kind of things may not
work 'all that well'?
 
Reply With Quote
 
 
 
 
J. Gleixner
Guest
Posts: n/a
 
      09-18-2009
Harry wrote:
> On Sep 18, 8:59 pm, RedGrittyBrick <(E-Mail Removed)>
> wrote:
>> If you want some sort of single executable that runs, without any
>> runtime support, on a variety of operating systems (even if they're all
>> the same x86 architecture) - I can't think of any programming language
>> where this is possible.

>
> What I want is
> an EXE for Windows, and
> an ELF for Linux
> each of which runs without any dependence on the Perl installation.


java.exe doesn't have any dependence...

You need to have perl installed if you want to run something written in
Perl.

Maybe this is what you're after??

perldoc -q "How can I get a binary version of perl"

Complete guess, since probably what you're asking for
isn't really what you need. What exactly are you trying to do?

 
Reply With Quote
 
Harry
Guest
Posts: n/a
 
      09-18-2009
On Sep 18, 9:17*pm, Jürgen Exner <(E-Mail Removed)> wrote:
> Harry <(E-Mail Removed)> wrote:
> >Also, I'm a bit surprised that the standard distribution for a great
> >and mature language like Perl doesn't already come with a tool for
> >this problem.

>
> Perl is an interpreted language and works very well as such. There are
> no compilers to generate executables for *tcsh, bash, awk, cmd, *...,
> either.


I see your point, Jue!
 
Reply With Quote
 
Harry
Guest
Posts: n/a
 
      09-18-2009
On Sep 18, 9:32*pm, Harry <(E-Mail Removed)> wrote:
> On Sep 18, 9:17*pm, Jürgen Exner <(E-Mail Removed)> wrote:
>
> > Harry <(E-Mail Removed)> wrote:
> > >Also, I'm a bit surprised that the standard distribution for a great
> > >and mature language like Perl doesn't already come with a tool for
> > >this problem.

>
> > Perl is an interpreted language and works very well as such. There are
> > no compilers to generate executables for *tcsh, bash, awk, cmd, *....,
> > either.

>
> I see your point, Jue!


Though, there's a py2exe for Python folks!
I don't use Python for my work, so, obviously, it's of no use for me.
 
Reply With Quote
 
Harry
Guest
Posts: n/a
 
      09-18-2009
On Sep 18, 9:31*pm, "J. Gleixner" <(E-Mail Removed)>
wrote:
> Harry wrote:
> > On Sep 18, 8:59 pm, RedGrittyBrick <(E-Mail Removed)>
> > wrote:
> >> If you want some sort of single executable that runs, without any
> >> runtime support, on a variety of operating systems (even if they're all
> >> the same x86 architecture) - I can't think of any programming language
> >> where this is possible.

>
> > What I want is
> > * * an EXE for Windows, and
> > * * an ELF for Linux
> > each of which runs without any dependence on the Perl installation.

>
> java.exe doesn't have any dependence...
>
> You need to have perl installed if you want to run something written in
> Perl.
>
> Maybe this is what you're after??
>
> perldoc -q "How can I get a binary version of perl"


Nope. Sorry for my imprecise original description of what I wanted
(and still want). Could I request you to look at my clarifications to
other posters of this thread...? otherwise, I'll be duplicating what I
just now said. (Thanks for taking the time to write.)
 
Reply With Quote
 
Harry
Guest
Posts: n/a
 
      09-18-2009
On Sep 18, 9:35*pm, Harry <(E-Mail Removed)> wrote:
> On Sep 18, 9:32*pm, Harry <(E-Mail Removed)> wrote:
>
> > On Sep 18, 9:17*pm, Jürgen Exner <(E-Mail Removed)> wrote:

>
> > > Harry <(E-Mail Removed)> wrote:
> > > >Also, I'm a bit surprised that the standard distribution for a great
> > > >and mature language like Perl doesn't already come with a tool for
> > > >this problem.

>
> > > Perl is an interpreted language and works very well as such. There are
> > > no compilers to generate executables for *tcsh, bash, awk, cmd, *....,
> > > either.

>
> > I see your point, Jue!

>
> Though, there's a py2exe for Python folks!
> I don't use Python for my work, so, obviously, it's of no use for me.


Hey, would this be technically possible? (Don't laugh.)
1. I get Perl to compile from Perl codebase on my machine.
2. Drop in my Perl script <somewhere> in the Perl codebase, make a
call to it from the main() function of Perl interpreter, and then
finally
3. Re-build Perl code base.

The EXE/ELF I now get will have Perl interpreter plus my script. I can
live with the LONG build times associated with step 1 and 3 above.
 
Reply With Quote
 
September Storm
Guest
Posts: n/a
 
      09-18-2009
Harry wrote:

> Though, there's a py2exe for Python folks!
> I don't use Python for my work, so, obviously, it's of no use for me.


The same problems exist for py2exe as well. Trying to have a tool
faithfully grab and properly parse interpreted code into something
usable/workable for a compiled binary isn't the easiest thing. They do
reasonably okay for what they are expected to do, even if the resulting
"to be compiled" code is ridiculously unreadable. It can work and
maybe (depending on what you want it to do) it can work fine for your
code and resulting program. But, it can't do everything. If you can
code in C or something for the platforms in question, that would be the
best route to go. But, try compiling the code and see how well it
works for you.
 
Reply With Quote
 
RedGrittyBrick
Guest
Posts: n/a
 
      09-18-2009

Harry wrote:
> On Sep 18, 9:35 pm, Harry <(E-Mail Removed)> wrote:
>> On Sep 18, 9:32 pm, Harry <(E-Mail Removed)> wrote:
>>
>>> On Sep 18, 9:17 pm, Jürgen Exner <(E-Mail Removed)> wrote:
>>>> Harry <(E-Mail Removed)> wrote:
>>>>> Also, I'm a bit surprised that the standard distribution for a great
>>>>> and mature language like Perl doesn't already come with a tool for
>>>>> this problem.
>>>> Perl is an interpreted language and works very well as such. There are
>>>> no compilers to generate executables for tcsh, bash, awk, cmd, ...,
>>>> either.
>>> I see your point, Jue!

>> Though, there's a py2exe for Python folks!
>> I don't use Python for my work, so, obviously, it's of no use for me.

>
> Hey, would this be technically possible? (Don't laugh.)
> 1. I get Perl to compile from Perl codebase on my machine.
> 2. Drop in my Perl script <somewhere> in the Perl codebase, make a
> call to it from the main() function of Perl interpreter, and then
> finally
> 3. Re-build Perl code base.
>
> The EXE/ELF I now get will have Perl interpreter plus my script. I can
> live with the LONG build times associated with step 1 and 3 above.


I didn't laugh, I seem to recall that, long ago, one way to make perl
scripts into executables involved creating a memory dump of a running
perl interpreter.

`perldoc -q compile` says

----------------------------------------------------------------------
The Perl Dev Kit ( http://www.activestate.com/Products/Perl_Dev_Kit/ )
from ActiveState can "Turn your Perl programs into ready-to-run
executables for HP-UX, *Linux*, Solaris and Windows."

Perl2Exe ( http://www.indigostar.com/perl2exe.htm ) is a command line
program for converting perl scripts to executable files. It targets both
Windows and *unix* platforms.
----------------------------------------------------------------------
(my *emphasis*)

A hop and a skip takes you to a download page
"Perl2Exe V9.100 for Linux (Jan 18 200"

--
RGB
 
Reply With Quote
 
Steve C
Guest
Posts: n/a
 
      09-18-2009
Harry wrote:
> On Sep 18, 9:35 pm, Harry <(E-Mail Removed)> wrote:
>> On Sep 18, 9:32 pm, Harry <(E-Mail Removed)> wrote:
>>
>>> On Sep 18, 9:17 pm, Jürgen Exner <(E-Mail Removed)> wrote:
>>>> Harry <(E-Mail Removed)> wrote:
>>>>> Also, I'm a bit surprised that the standard distribution for a great
>>>>> and mature language like Perl doesn't already come with a tool for
>>>>> this problem.
>>>> Perl is an interpreted language and works very well as such. There are
>>>> no compilers to generate executables for tcsh, bash, awk, cmd, ...,
>>>> either.
>>> I see your point, Jue!

>> Though, there's a py2exe for Python folks!
>> I don't use Python for my work, so, obviously, it's of no use for me.

>
> Hey, would this be technically possible? (Don't laugh.)
> 1. I get Perl to compile from Perl codebase on my machine.
> 2. Drop in my Perl script <somewhere> in the Perl codebase, make a
> call to it from the main() function of Perl interpreter, and then
> finally
> 3. Re-build Perl code base.
>
> The EXE/ELF I now get will have Perl interpreter plus my script. I can
> live with the LONG build times associated with step 1 and 3 above.



Why not include the OS as well? Then you only need one executable for
each architecture.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Running an Executable Before Executable JAR Jason Cavett Java 8 05-16-2007 07:14 PM
How to make perl script executable from anywhere on windows? veg_all@yahoo.com Perl Misc 2 04-21-2007 04:10 PM
what is fast dynamically linked executable or statically linked executable ?how to decide? pratap C Programming 20 03-07-2007 04:46 AM
How can I run a c executable in pwd ,while the executable is in some other directory vishsid3@gmail.com C Programming 15 08-21-2006 06:04 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments