pass by reference from parent to child
by Bruce other posts by this author
Aug 1 2004 9:18PM messages near this date
view in the new Beta List Site
RE: perl problem, continued - serializing...
|
Re: perl problem, continued - serializing...
hi...
is it possible to pass an arg by ref from parent to child via exec/system
shell and be able to retrieve the original value...
#
#use strict;
use DBI;
require ('mysql.inc');
my $dbh = "";
print "open db\n";
$dbh = open_dbi();
# at this point, dbh should be the connection id...
print "dbh = ".$dbh."\n";
my $db1;
my $db2;
$db1 = \$dbh;
print "db1 = ".$db1."\n";
system 'perl', 'aaa.pl', $db1;
$db2 = $$db1;
print "db2 = ".$db2."\n";
this successfully gets 'db2' to have 'dbh', which is what one expects...
and within the child app, it actually gets the correct REF... however, i'm
not sure if it's possible to retrieve the actual val via this approach..
using the $$arg doesn't get the correct val in the child app...
thanks
-bruce
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
bruce
Tobias Hoellrich
bruce
Bruce
Rhesa Rozendaal
|