| Store | Cart
Lists » pdk

Re: Find out thet perl script runs from binary (compiled) or native code

From: Bart Terryn <b...@xp2.be>
Mon, 02 Apr 2012 12:58:21 +0200
On 2/04/2012 12:42, Zsolt Hidasi wrote:
> Hi Experts,>> I need help how to find out that perl script is runned from binary > (compiled) or native code. I need it some publishing differences, > cause I'd like to publish the same code in native and compiled version > and some feature of my script depends on the source (if it's compiled > or not).>> Is there any way to get it from a special variable like $0 or > something similar?>> The problem is, if you call a compiled (windows version) exe program > without the *.exe extension then the $0 gives only the called name of > the program. I suppose that should be enough if I knew a variable > which would told me its own extension...>> Thx for your replies in advance: Zsolt>>> _______________________________________________> PDK mailing list> P...@listserv.ActiveState.com> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Zsolt,

The way I detect whether I'm running from the .exe or the .pl is to 
check the $PerlApp::VERSION.
If it is defined you are running from the .exe and it will contain the 
version of your perlapp.
If you are running from the .pl it will be undefined.

There might be other ways to detect his...
See http://docs.activestate.com/pdk/6.0/PerlApp.html for more info...

Hope this helps

Bart
XP2


begin:vcard
fn:Bart Terryn
n:Terryn;Bart
org:XP2
adr:;;Lazerijstraat 9;Boechout;;2530;Belgium
email;internet:b...@xp2.be
tel;work:+32 3 4544988
tel;cell:+32 473 281919
url:http://www.xp2.be
version:2.1
end:vcard


_______________________________________________
PDK mailing list
P...@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Recent Messages in this Thread
Zsolt Hidasi Apr 02, 2012 10:42 am
Bart Terryn Apr 02, 2012 10:58 am
Jan Dubois Apr 02, 2012 10:20 pm
Zsolt Hidasi Apr 03, 2012 07:22 am
$Bill Luebkert Apr 02, 2012 11:00 pm
Messages in this thread