Hello,
I have most part of the solution. The --reusable option did the trick.
Here how I did it:
pp-o packed_script--reusable main_script.pl
#############################################################
# part in the main_script.pl where the helper script is invoked
#############################################################
my $cmd;
if( defined $ENV{PAR_TEMP} )
{
$cmd = "$0 --par-options --reuse helper_script.pl";
}
else
{
$cmd = "perl helper_script.pl";
}
# execute external command
Problems which still have to be solved. Help is welcome.
1.) helper_script.pl is not part of the packed executable
--> helper_script.pl shall be within the packed executable
2.) needed modules of "helper_script.pl" also have to be part of the
packed executable
The solution is near. I hope you can help me to fix the last two open
points. I'll investigate too and post updates when I know more.
Cheers,
Dirk
Am 14.03.2012 22:04, schrieb Dirk Joos:
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
gesendet.
------------------------------------------------------------------------
*Von:* Dirk Joos <d...@dirkundsari.de>
*Gesendet:* Wed Mar 14 16:59:39 MEZ 2012
*An:* Roderich Schupp <roderich.sch...@googlemail.com>
*CC:* par@perl.org
*Betreff:* Re: Packing multiple scripts in a standalone executable with pp
You are right. Using several separately packed scripts would be too
much runtime overhead. And this would lead to several packed files
although I would prefer a single file.
But I discovered the --reusable option of pp. When reading the
documentation I thought that this is exactly what I need.
Of course there are then two variants of the script. A packed one and
a normal one. But one more if statement wouldn't matter.
Am I right? Is the --reusable option of pp possibly the thing I'm
looking for?
Thank you.
Cheers, Dirk
Roderich Schupp <roderich.sch...@googlemail.com> schrieb:
On Wed, Mar 14, 2012 at 13:58, Dirk Joos<d...@dirkundsari.de> wrote:
> And sorry for asking again. Why isn't it planned?
Because... there is no plan (at least I don't have one).
> Don' t you think that this would be an important feature?
No, I don't think so.
> What could be a workaround? Perhaps packing each script separately and
then
> calling the packed stuff instead of using a second perl interpreter?
Sure, if your're willing to accept the runtime overhead.
It also means that you would have two variants of your program -
one when running normaly, the other when running packed.
Cheers, Roderich
--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
gesendet.