Grokbase
Topics Posts Groups | in
x
[ help ]

Louis-Philippe (l0u1sph1...@spiraliens.org)

Profile | Posts (3)

User Information

Display Name:Louis-Philippe
Partial Email Address:l0u1sph1...@spiraliens.org
Posts:
3 total
3 in PAR

3 Most Recent

1) Louis-Philippe Re: cwd in pp
| +1 vote
I tested it also on my OSX 10.4 machine, seems that anywhere I execute my script I get the proper...
PAR
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
I tested it also on my OSX 10.4 machine,
seems that anywhere I execute my script I get the proper variable inside $0,

thanks guys!

l-p


[email protected: ----mark.do...@znix.com] wrote ----

Hi Steffen,

I did think this trough.

On my Win32 box, as a packed pp exec, test.exe called as

..\..\test.exe

or just test.exe

gets

C:\fullpath\to\test.exe

in $0.

So, anything that parses $0 and uses the result correctly when it is a script ( so gets the right path whether $0 contains C:\fullpath\to\test.exe or ..\..\test.exe or .\test.exe or test.exe ), will always work when $0 contains a full path.

I can't speak for PerlApp - didn't check that out.

Best Regards

Mark



Steffen Mueller wrote:
> Hi Louis-Philippe,
>
> Louis-Philippe schrieb:
>> Thanks Mark! thats it:
>>
>> script: $0 =
>> /Volumes/KanDriv/svn_repos/alpha/trunk/perl/svn_tools/testDir.pl $^X
>> = /usr/bin/perl
>>
>> with pp: $0 =
>> /Volumes/KanDriv/svn_repos/alpha/trunk/perl/svn_tools/testDir_pp $^X
>> = perl
>>
>> with PerlApp: $0 =
>> /Volumes/KanDriv/svn_repos/alpha/trunk/perl/svn_tools/testDir_perlapp
>>  $^X = perl
>>
>>
>> so that happen to be the most portable way of doing it, this way I
>> don't have to modify my programs to package them with either utility.
>
> For more detailed information about the various paths involved in a
> PAR-packaged binary, you could read the PAR::Environment POD
> documentation which comes with PAR-Packer. Of course, if this is already
> exactly what you need, that's fine. But please try putting a pp'd binary
> into PATH and executing it from a different path. Is $0 ($^X) still the
> same? If not, one of the PAR environment vars would help.
>
> Best regards,
> Steffen
2) Louis-Philippe Re: cwd in pp
| +1 vote
Thanks Mark! thats it: script: $0 =...
PAR
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Thanks Mark!
thats it:

script:
$0 = /Volumes/KanDriv/svn_repos/alpha/trunk/perl/svn_tools/testDir.pl
$^X = /usr/bin/perl

with pp:
$0 = /Volumes/KanDriv/svn_repos/alpha/trunk/perl/svn_tools/testDir_pp
$^X = perl

with PerlApp:
$0 = /Volumes/KanDriv/svn_repos/alpha/trunk/perl/svn_tools/testDir_perlapp
$^X = perl


so that happen to be the most portable way of doing it, this way I don't have to modify my programs to package them with either utility.

l-p


[email protected: ----mark.do...@znix.com] wrote ----

Hi,

from memory, $0 contains the full path to your exec when packaged.

Try packaging

print qq(\$0 = $0\n);
print qq(\$^X = $^X\n);

and see what it gives you.

This should mean that $0 should always work in packaged code if it worked in the script. (I think !!!)

Regards

Mark



Louis-Philippe wrote:
> Hi All,
>
> I am new to PAR & pp, I discovered it this week when I ran into trouble trying to package scripts with PerlApp that PerlApp wouln't package because of version compatibility... so I tried pp an just felt in love with is simplicity & free nature.
>
> so, now I am trying to port my script to pp, and one command is missing from my toolkit:
> in PerlApp, I am aple to call PerlApp::exe() to get the executable file directory,
> something I would do with cwd() inside of a straight .pl script...
> I tried cwd() with a pp executable and it returns the shell working directory (i.e. my home folder).
> anybody knows how to grab the executable directory path with pp?
>
> thanks!
>
> l-p
3) Louis-Philippe cwd in pp
| +1 vote
Hi All, I am new to PAR & pp, I discovered it this week when I ran into trouble trying to package...
PAR
[ Profile | Reply to group ] [ Flat  Thread  Threaded ]
Hi All,

I am new to PAR & pp, I discovered it this week when I ran into trouble trying to package scripts with PerlApp that PerlApp wouln't package because of version compatibility... so I tried pp an just felt in love with is simplicity & free nature.

so, now I am trying to port my script to pp, and one command is missing from my toolkit:
in PerlApp, I am aple to call PerlApp::exe() to get the executable file directory,
something I would do with cwd() inside of a straight .pl script...
I tried cwd() with a pp executable and it returns the shell working directory (i.e. my home folder).
anybody knows how to grab the executable directory path with pp?

thanks!

l-p

spacer
Profile | Posts (3)
Home > People > Louis-Philippe