Hi there, 

I am pretty new to the whole PAR stuff and started to experiment with it
since a couple of days.

I am trying to create an executable with pp of my gtk2-perl app which is
working great except for my plugin interface.
I am using Gtk2::Socket and Gtk2::Plug to attach/integrate other
gtk2-perl scripts into my main app. The relevant code snippets look like
this:

Main Program:

--snip--

my $socket = Gtk2::Socket->new;
printf( "\n", $socket->get_id );
my $pid = fork;
if ( $pid < 0 ) {
        #something else
}
if ( $pid == 0 ) {              
        exec(
                sprintf(
                        "$^X <external script with arguments>\n",
                        $socket->get_id )
        );
}

--snip--

Plugin:

--snip--

use Gtk2 '-init';
use Image::Magick;

#these variables are passed to the plugin
my $socket_id = $ARGV[ 0 ];

my $plug = Gtk2::Plug->new( $socket_id );

--snip--

Calling the external script with exec does not work, because the
external script does not run in PAR's namespace, so it complains about
missing Gtk2.pm and missing Image/Magick.pm even though is is packed in
the PAR. (Of course this works on my dev machine because the standard
perl environment does provide all of these modules, but it should work
on other platforms as well)

Whe I try to manipulate the @INC Variable within the external scripts
and unshift the PAR's temp dir to it, the external script dies with some
strange errors like "Can't locate loadable object for module Glib in
@INC".


Is there any trick in calling an external perl script when using PAR?
I've tried to search the mailing-list for that but things like do
'external script'; don't work...

Maybe you can check http://prlmnks.org/html/562285.html if you might
want to have a complete socket and plug example.

Thank you very much for your help.

Greetings
Mario


Reply via email to