[31351] in Perl-Users-Digest
Perl-Users Digest, Issue: 2603 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Sep 18 14:09:52 2009
Date: Fri, 18 Sep 2009 11:09:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 18 Sep 2009 Volume: 11 Number: 2603
Today's topics:
FAQ 8.8 How do I get the screen size? <brian@theperlreview.com>
Newbie: Perl script to Windows and Linux executable ver <simonsharry@gmail.com>
Re: Newbie: Perl script to Windows and Linux executable <jurgenex@hotmail.com>
Re: Newbie: Perl script to Windows and Linux executable <simonsharry@gmail.com>
Re: Newbie: Perl script to Windows and Linux executable <RedGrittyBrick@spamweary.invalid>
Re: Newbie: Perl script to Windows and Linux executable <simonsharry@gmail.com>
Re: Newbie: Perl script to Windows and Linux executable <simonsharry@gmail.com>
Re: Newbie: Perl script to Windows and Linux executable <jurgenex@hotmail.com>
Re: Newbie: Perl script to Windows and Linux executable <RedGrittyBrick@spamweary.invalid>
Re: Newbie: Perl script to Windows and Linux executable <jurgenex@hotmail.com>
Re: Newbie: Perl script to Windows and Linux executable <simonsharry@gmail.com>
Re: Newbie: Perl script to Windows and Linux executable <simonsharry@gmail.com>
Re: Newbie: Perl script to Windows and Linux executable <glex_no-spam@qwest-spam-no.invalid>
Re: Newbie: Perl script to Windows and Linux executable <simonsharry@gmail.com>
Re: Newbie: Perl script to Windows and Linux executable <simonsharry@gmail.com>
Re: Newbie: Perl script to Windows and Linux executable <simonsharry@gmail.com>
Re: Newbie: Perl script to Windows and Linux executable <simonsharry@gmail.com>
Re: Newbie: Perl script to Windows and Linux executable <it.is.me@an.invalid>
Re: Newbie: Perl script to Windows and Linux executable <RedGrittyBrick@spamweary.invalid>
Re: Newbie: Perl script to Windows and Linux executable <smallpond@juno.com>
Re: Newbie: Regular expresion <smallpond@juno.com>
Re: perl script execution take a long time <cartercc@gmail.com>
Re: perl script execution take a long time <jurgenex@hotmail.com>
Re: perl script execution take a long time <cartercc@gmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 18 Sep 2009 16:00:02 GMT
From: PerlFAQ Server <brian@theperlreview.com>
Subject: FAQ 8.8 How do I get the screen size?
Message-Id: <68Osm.237990$ZN.112506@newsfe23.iad>
This is an excerpt from the latest version perlfaq8.pod, which
comes with the standard Perl distribution. These postings aim to
reduce the number of repeated questions as well as allow the community
to review and update the answers. The latest version of the complete
perlfaq is at http://faq.perl.org .
--------------------------------------------------------------------
8.8: How do I get the screen size?
If you have Term::ReadKey module installed from CPAN, you can use it to
fetch the width and height in characters and in pixels:
use Term::ReadKey;
($wchar, $hchar, $wpixels, $hpixels) = GetTerminalSize();
This is more portable than the raw "ioctl", but not as illustrative:
require 'sys/ioctl.ph';
die "no TIOCGWINSZ " unless defined &TIOCGWINSZ;
open(TTY, "+</dev/tty") or die "No tty: $!";
unless (ioctl(TTY, &TIOCGWINSZ, $winsize='')) {
die sprintf "$0: ioctl TIOCGWINSZ (%08x: $!)\n", &TIOCGWINSZ;
}
($row, $col, $xpixel, $ypixel) = unpack('S4', $winsize);
print "(row,col) = ($row,$col)";
print " (xpixel,ypixel) = ($xpixel,$ypixel)" if $xpixel || $ypixel;
print "\n";
--------------------------------------------------------------------
The perlfaq-workers, a group of volunteers, maintain the perlfaq. They
are not necessarily experts in every domain where Perl might show up,
so please include as much information as possible and relevant in any
corrections. The perlfaq-workers also don't have access to every
operating system or platform, so please include relevant details for
corrections to examples that do not work on particular platforms.
Working code is greatly appreciated.
If you'd like to help maintain the perlfaq, see the details in
perlfaq.pod.
------------------------------
Date: Fri, 18 Sep 2009 08:17:06 -0700 (PDT)
From: Harry <simonsharry@gmail.com>
Subject: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <274042ff-80f7-4f66-b9ba-7d1c1b3fb840@a37g2000prf.googlegroups.com>
Hey folks,
I have a perl script that I'd like to be able to run on Windows and
Linux. Is this easily possible?
Here's what I've tried so far... unsuccessfully!
I've tried to install PAR::Packer from CPAN. After having successfully
installed all its dependencies manually, I discovered that I couldn't
install PAR::Packer itself. I got the message:
Can't locate ExtUtils/Embed.pm in @INC ...
I then tried installing ExtUtils/Embed.pm from CPAN. Couldn't. This is
what I got:
CPAN.pm: Going to build D/DO/DOUGM/ExtUtils-Embed-1.14.tar.gz
Writing files for ExtUtils::Embed tests...
Can't locate ExtUtils/Embed.pm in @INC (@INC contains:
Not sure what the current recommended method is in the community for
what I'm trying to do. I'm looking for a 100% free/opensource
solution. Perl2Exe works but only on Windows and with an irritating a
few seconds delay on each invocation.
Regards,
/HS
------------------------------
Date: Fri, 18 Sep 2009 08:55:56 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <1oa7b5pc1kuqdq9k844ni950fa4jtoq60v@4ax.com>
Harry <simonsharry@gmail.com> wrote:
>I have a perl script that I'd like to be able to run on Windows and
>Linux. Is this easily possible?
Yes, it is. See "perldoc perlport" for hints about which OS-specific
functions and features to avoid.
Basically you need to watch out for the different representations for
newline and of course using system() or file system specific features is
a no-no.
For some areas like parallel programming, process control, networking,
etc. it can become tricky, too.
>Here's what I've tried so far... unsuccessfully!
>I've tried to install PAR::Packer from CPAN.
Why? It has nothing to do with writing cross-platform code.
>Not sure what the current recommended method is in the community for
>what I'm trying to do. I'm looking for a 100% free/opensource
>solution.
Again, see the FAQ I mentioned above.
>Perl2Exe works but only on Windows and with an irritating a
>few seconds delay on each invocation.
Again, why? It has nothing to do with portable code.
jue
------------------------------
Date: Fri, 18 Sep 2009 08:57:41 -0700 (PDT)
From: Harry <simonsharry@gmail.com>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <aad04ca3-1c1d-4ebc-a1d1-562d53a86ad9@h40g2000prf.googlegroups.com>
On Sep 18, 8:17=A0pm, Harry <simonsha...@gmail.com> wrote:
> Hey folks,
>
> I have a perl script that I'd like to be able to run on Windows and
> Linux. Is this easily possible?
>
> Here's what I've tried so far... unsuccessfully!
>
> I've tried to install PAR::Packer from CPAN. After having successfully
> installed all its dependencies manually, I discovered that I couldn't
> install PAR::Packer itself. I got the message:
> =A0 =A0 Can't locate ExtUtils/Embed.pm in @INC ...
>
> I then tried installing ExtUtils/Embed.pm from CPAN. Couldn't. This is
> what I got:
> =A0 =A0 =A0 CPAN.pm: Going to build D/DO/DOUGM/ExtUtils-Embed-1.14.tar.gz
> =A0 Writing files for ExtUtils::Embed tests...
> =A0 Can't locate ExtUtils/Embed.pm in @INC (@INC contains:
>
> Not sure what the current recommended method is in the community for
> what I'm trying to do. I'm looking for a 100% free/opensource
> solution. Perl2Exe works but only on Windows and with an irritating a
> few seconds delay on each invocation.
>
> Regards,
> /HS
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.
------------------------------
Date: Fri, 18 Sep 2009 16:59:09 +0100
From: RedGrittyBrick <RedGrittyBrick@spamweary.invalid>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <4ab3ae4e$0$2477$db0fefd9@news.zen.co.uk>
Harry wrote:
>
> I have a perl script that I'd like to be able to run on Windows and
> Linux. Is this easily possible?
>
1) Yes
Save your script in an ASCII file with a .pl filename extension. It
should then run on Linux or Windows.
Obviously the operating system needs runtime support for Perl, but that
isn't a problem for most server/desktop/notebook PC operating systems.
All modern Unix systems and mainstream server/desktop/notebook Linux
distributions will include perl as part of the normal environment. For
any Windows platform you have a choice of installable 3rd-party Perl
runtimes, Activestate Perl for example.
2) No
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.
--
RGB
------------------------------
Date: Fri, 18 Sep 2009 09:05:17 -0700 (PDT)
From: Harry <simonsharry@gmail.com>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <7c70afff-a49e-48dc-8c90-d820d59b68e7@p10g2000prm.googlegroups.com>
On Sep 18, 8:55=A0pm, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> Harry <simonsha...@gmail.com> wrote:
> >I have a perl script that I'd like to be able to run on Windows and
> >Linux. Is this easily possible?
>
> Yes, it is. See "perldoc perlport" for hints about which OS-specific
> functions and features to avoid.
> Basically you need to watch out for the different representations for
> newline and of course using system() or file system specific features is
> a no-no.
> For some areas like parallel programming, process control, networking,
> etc. it can become tricky, too.
>
> >Here's what I've tried so far... unsuccessfully!
> >I've tried to install PAR::Packer from CPAN.
>
> Why? It has nothing to do with writing cross-platform code.
>
> >Not sure what the current recommended method is in the community for
> >what I'm trying to do. I'm looking for a 100% free/opensource
> >solution.
>
> Again, see the FAQ I mentioned above.
>
> >Perl2Exe works but only on Windows and with an irritating a
> >few seconds delay on each invocation.
>
> Again, why? It has nothing to do with portable code.
>
> jue
J=FCrgen, sorry if I mis-spoke.
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.
Thanks for your quick response!
------------------------------
Date: Fri, 18 Sep 2009 09:11:16 -0700 (PDT)
From: Harry <simonsharry@gmail.com>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <cd0d1784-1901-486b-acf8-088ef3876a7c@2g2000prl.googlegroups.com>
On Sep 18, 8:59=A0pm, RedGrittyBrick <RedGrittyBr...@spamweary.invalid>
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.
Thanks, RGB (for taking the time to write)!
------------------------------
Date: Fri, 18 Sep 2009 09:14:52 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <n9c7b513mg4c0i71t3icevrpqonakg3s67@4ax.com>
Harry <simonsharry@gmail.com> 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.
jue
------------------------------
Date: Fri, 18 Sep 2009 17:15:45 +0100
From: RedGrittyBrick <RedGrittyBrick@spamweary.invalid>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <4ab3b232$0$2475$db0fefd9@news.zen.co.uk>
Harry wrote:
> On Sep 18, 8:17 pm, Harry <simonsha...@gmail.com> wrote:
>> Hey folks,
>>
>> I have a perl script that I'd like to be able to run on Windows and
>> Linux. Is this easily possible?
>>
>> Here's what I've tried so far... unsuccessfully!
>>
>> I've tried to install PAR::Packer from CPAN. After having successfully
>> installed all its dependencies manually, I discovered that I couldn't
>> install PAR::Packer 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
(perl -v)?
>>
>> I then tried installing ExtUtils/Embed.pm from CPAN. Couldn't. This is
>> what I got:
>> CPAN.pm: Going to build D/DO/DOUGM/ExtUtils-Embed-1.14.tar.gz
>> Writing files for ExtUtils::Embed tests...
>> Can't locate ExtUtils/Embed.pm in @INC (@INC contains:
>>
>> Not sure what the current recommended method is in the community for
>> what I'm trying to do. I'm looking for a 100% free/opensource
>> solution. Perl2Exe works but only on Windows and with an irritating a
>> few seconds delay on each invocation.
>>
>
> 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.
I don't find it a problem! I use the same .pl files in Windows and Linux
(so long as they don't use OS-specific features/resources)
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?
--
RGB
------------------------------
Date: Fri, 18 Sep 2009 09:17:05 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <9gc7b5p6uku5brmjb0j57plgmnm46c9skc@4ax.com>
Harry <simonsharry@gmail.com> 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.
jue
------------------------------
Date: Fri, 18 Sep 2009 09:27:44 -0700 (PDT)
From: Harry <simonsharry@gmail.com>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <a151a71e-2913-4f87-afff-7701bc3354d7@a37g2000prf.googlegroups.com>
On Sep 18, 9:15=A0pm, RedGrittyBrick <RedGrittyBr...@spamweary.invalid>
wrote:
> Harry wrote:
> >> I've tried to install PAR::Packer from CPAN. After having successfully
> >> installed all its dependencies manually, I discovered that I couldn't
> >> install PAR::Packer itself. I got the message:
> >> =A0 =A0 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::Dist
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.
------------------------------
Date: Fri, 18 Sep 2009 09:30:45 -0700 (PDT)
From: Harry <simonsharry@gmail.com>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <a2b6e843-15d9-41e8-83d4-b4958656a285@s21g2000prm.googlegroups.com>
On Sep 18, 9:14=A0pm, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> Harry <simonsha...@gmail.com> 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'?
------------------------------
Date: Fri, 18 Sep 2009 11:31:37 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <4ab3b5ea$0$89869$815e3792@news.qwest.net>
Harry wrote:
> On Sep 18, 8:59 pm, RedGrittyBrick <RedGrittyBr...@spamweary.invalid>
> 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?
------------------------------
Date: Fri, 18 Sep 2009 09:32:02 -0700 (PDT)
From: Harry <simonsharry@gmail.com>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <f60500df-faca-4e1f-8bc0-6267095afd03@d9g2000prh.googlegroups.com>
On Sep 18, 9:17=A0pm, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> Harry <simonsha...@gmail.com> 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 =A0tcsh, bash, awk, cmd, =A0...,
> either.
I see your point, Jue! :-(
------------------------------
Date: Fri, 18 Sep 2009 09:35:33 -0700 (PDT)
From: Harry <simonsharry@gmail.com>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <7098d3eb-7d3c-48c3-95bd-36f47f2f5035@u36g2000prn.googlegroups.com>
On Sep 18, 9:32=A0pm, Harry <simonsha...@gmail.com> wrote:
> On Sep 18, 9:17=A0pm, J=FCrgen Exner <jurge...@hotmail.com> wrote:
>
> > Harry <simonsha...@gmail.com> 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 =A0tcsh, bash, awk, cmd, =A0..=
.,
> > 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.
------------------------------
Date: Fri, 18 Sep 2009 09:42:35 -0700 (PDT)
From: Harry <simonsharry@gmail.com>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <f72ec987-9e7f-47d8-9123-f875a98ff11c@m3g2000pri.googlegroups.com>
On Sep 18, 9:31=A0pm, "J. Gleixner" <glex_no-s...@qwest-spam-no.invalid>
wrote:
> Harry wrote:
> > On Sep 18, 8:59 pm, RedGrittyBrick <RedGrittyBr...@spamweary.invalid>
> > 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 al=
l
> >> the same x86 architecture) - I can't think of any programming language
> >> where this is possible.
>
> > What I want is
> > =A0 =A0 an EXE for Windows, and
> > =A0 =A0 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.)
------------------------------
Date: Fri, 18 Sep 2009 09:52:43 -0700 (PDT)
From: Harry <simonsharry@gmail.com>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <bfdfe230-8206-4790-8d14-bfadcc8a1f09@j9g2000prh.googlegroups.com>
On Sep 18, 9:35=A0pm, Harry <simonsha...@gmail.com> wrote:
> On Sep 18, 9:32=A0pm, Harry <simonsha...@gmail.com> wrote:
>
> > On Sep 18, 9:17=A0pm, J=FCrgen Exner <jurge...@hotmail.com> wrote:
>
> > > Harry <simonsha...@gmail.com> 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 ar=
e
> > > no compilers to generate executables for =A0tcsh, bash, awk, cmd, =A0=
...,
> > > 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.
------------------------------
Date: Fri, 18 Sep 2009 10:04:06 -0700
From: September Storm <it.is.me@an.invalid>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <a4Psm.129378$nL7.1153@newsfe18.iad>
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.
------------------------------
Date: Fri, 18 Sep 2009 18:32:35 +0100
From: RedGrittyBrick <RedGrittyBrick@spamweary.invalid>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <4ab3c434$0$2542$da0feed9@news.zen.co.uk>
Harry wrote:
> On Sep 18, 9:35 pm, Harry <simonsha...@gmail.com> wrote:
>> On Sep 18, 9:32 pm, Harry <simonsha...@gmail.com> wrote:
>>
>>> On Sep 18, 9:17 pm, Jürgen Exner <jurge...@hotmail.com> wrote:
>>>> Harry <simonsha...@gmail.com> 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 2008)"
--
RGB
------------------------------
Date: Fri, 18 Sep 2009 13:42:09 -0400
From: Steve C <smallpond@juno.com>
Subject: Re: Newbie: Perl script to Windows and Linux executable versions.
Message-Id: <h90gpv$13v$1@news.eternal-september.org>
Harry wrote:
> On Sep 18, 9:35 pm, Harry <simonsha...@gmail.com> wrote:
>> On Sep 18, 9:32 pm, Harry <simonsha...@gmail.com> wrote:
>>
>>> On Sep 18, 9:17 pm, Jürgen Exner <jurge...@hotmail.com> wrote:
>>>> Harry <simonsha...@gmail.com> 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.
------------------------------
Date: Fri, 18 Sep 2009 12:12:31 -0400
From: Steve C <smallpond@juno.com>
Subject: Re: Newbie: Regular expresion
Message-Id: <h90bhs$kh1$1@news.eternal-september.org>
Jose Luis wrote:
> Hi,
>
> Given the string "one;two;three;four...", is there a easy way to
> print "one":
>
>
> $ echo "one;two;three;four..."|perl -e 'while(<>){$_ =~ /^(.*)(\;)(.*)
> $/ && print $1}'
> one;two;three
>
>
Use 'sed mode':
echo "one;two;three;four..."|perl -pe 's/;.*//'
one
autosplit lets you pick other than first element:
echo "one;two;three;four..."|perl -lanF';' -e'print $F[1]'
two
------------------------------
Date: Fri, 18 Sep 2009 09:04:21 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: perl script execution take a long time
Message-Id: <a41b2226-610e-4eef-a8f1-760de563694f@g23g2000vbr.googlegroups.com>
On Sep 18, 10:23=A0am, Tad J McClellan <ta...@seesig.invalid> wrote:
> Write your program differently.
What he means is, code the computationally intensive parts of your
program in assembly.
CC.
------------------------------
Date: Fri, 18 Sep 2009 09:20:25 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: perl script execution take a long time
Message-Id: <ulc7b5d92se7dp330mlcfkpk3liu8tt4bh@4ax.com>
ccc31807 <cartercc@gmail.com> wrote:
>On Sep 18, 10:23 am, Tad J McClellan <ta...@seesig.invalid> wrote:
>> Write your program differently.
>
>What he means is, code the computationally intensive parts of your
>program in assembly.
From what I know about Tad rather not.
The vagueness of his answer matched the vagueness of the question
exactly. And if he meant something more specific (which I find unlikely)
then he was probably suggesting to choose a different more efficient
algorithm.
jue
------------------------------
Date: Fri, 18 Sep 2009 09:34:47 -0700 (PDT)
From: ccc31807 <cartercc@gmail.com>
Subject: Re: perl script execution take a long time
Message-Id: <2f5c12aa-95a1-4081-b021-96101af5c386@d4g2000vbm.googlegroups.com>
On Sep 18, 12:20=A0pm, J=FCrgen Exner <jurge...@hotmail.com> wrote:
> >What he means is, code the computationally intensive parts of your
> >program in assembly.
>
> From what I know about Tad rather not.
It was a joke. Maybe I should have used a smiley. ;-)
CC.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 2603
***************************************