Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^6: Perl CGI and SQL statements

by osunderdog (Deacon)
on Apr 19, 2006 at 11:56 UTC ( [id://544330]=note: print w/replies, xml ) Need Help??


in reply to Re^5: Perl CGI and SQL statements
in thread Perl CGI and SQL statements

my $db = new Win32::ODBC('$DSN');

The declaration of $db is too low. The variable is being declared in an if check and it's being referenced in an outer scope. Declare $db higher up in a block where it's visible to both the case where you assign it and where you reference it. The outer scope would work, that's where you've defined the $cgi variable.

Hazah! I'm Employed!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://544330]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-25 06:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found