Re: perl problem, continued - serializing...
by Rhesa Rozendaal other posts by this author
Aug 1 2004 7:40PM messages near this date
view in the new Beta List Site
pass by reference from parent to child
|
[xsl] Writing out to and reading back from an XML file
Hi bruce,
> i've tried a couple of the serial/deserializing mods from cpan. i've tried
> to create the dbi mysql connection handle, and then serialize/deserialize
> the handle, with the expectation that i could then use the result in the
> same test app to perform the dbi functions... either it can't be done, or
> i'm missing something. the results i'm getting back from the
> serialize/deserialize functions is not the orginal dbi handle....
I'm sorry, but you can't serialize a database connection. Serializing
essentially means you get a string _describing_ the object. You could
even email me that string, and if it were a regular hash or some such, I
could reconstruct it in a perl script. I'm sure you don't expect me to
be able to get a valid database connection out of that though!
What you can do though, is change the way you call the other perl
script. Since you're calling perl from within perl, it makes little
sense to spawn a new perl interpreter.
You're better off using "require" or "do". That has the advantage that
the "require"'d script has full access to your variables, and vice versa.
So instead of:
system 'perl', 'aaa.pl', $dbh;
do
do "aaa.pl";
HTH,
Rhesa
_______________________________________________
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
|