ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-win32-users
perl-win32-users
[xsl] Writing out to and reading back from an XML file
by Chris Loschen other posts by this author
Aug 1 2004 6:07PM messages near this date
view in the new Beta List Site
Re: perl problem, continued - serializing... | Perl CGI Treeview
Hi again all,

I posted this the other day, but made the mistake of buryin---------------------
#

#use strict;
use DBI;

require ('mysql.inc');

# $ARGV is a perl var.. no need to declare
my $arg = $ARGV[0];
print "aaa  arg = ".$arg."\n";

# setup the db connection process...(global)
# in case we need to do a rollback at some time...
my ($sth, $rv)="";
my $dbh = $arg;



# at this point, dbh should be the connection id...
print "aaa  dbh = ".$dbh."\n";

# make a test call to the db to verify that it works...
#
my $test_sql = 'select * from stateTBL';
print "sql = $test_sql\n";

$sth = $dbh-> prepare($test_sql);
...

now, at this point, i assumed that the app would be ok. in fact, displaying
the '$arg' value and comparing it to the '$dbh' value in the parent app
appeared to give the same value, as seen when i ran the test, and viewed the
output. however, something is going on that i don't fully understand...

the test output is...:
[root@lserver2 test]# perl mysql_client.pl
open db
dbh = DBI::db=HASH(0x81a1bbc)   <<<<<<<<<<<<<<<< parent app....
dbharray = ARRAY(0x80fbd3c)
aaa  arg = DBI::db=HASH(0x81a1bbc)  <<<<<<<<<<<<< child app.....
aaa _db = DBI::db=HASH(0x81a1bbc)
aaa  dbh = DBI::db=HASH(0x81a1bbc)
sql = select * from stateTBL
Can't locate object method "prepare" via package "DBI::db=HASH(0x81a1bbc)"
(perhaps you forgot to load "DBI::db=HASH(0x81a1bbc)"?) at aaa.pl line 50.
sql = select * from stateTBL

so, as you can see, it appears that the apps have the same value, and that
we should be ok... but the error statement suggests that perl is doing
something with the value, that suggests i have totally screwed things up, or
that i can't simply "pass" the var from the parent to the child as i thought
i could!!!!!

any ideas/suggestions/comments/etc on how one should actually pass vars from
a parent to a child..????

thanks

-bruce



_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Thread:
Chris Loschen
Michael Kay

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved