Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: DBI script runs from command line, not from CGI

by wardk (Deacon)
on Apr 16, 2002 at 16:25 UTC ( [id://159552]=note: print w/replies, xml ) Need Help??


in reply to DBI script runs from command line, not from CGI

I don't see any exception handling in the DBI calls (prepare, execute). try adding something like:
$sth->execute($i, $data{$i}{cname}, $j, $data{$i}{ports}{$j}{service}, + $data{$i}{ports}{$j}{banner}) or die "Content-type: text/plain\n\n $ +DBI::errstr";
(the prepare is also an excellent candidate as well)

Replies are listed 'Best First'.
Re: Re: DBI script runs from command line, not from CGI
by tachyon (Chancellor) on Apr 16, 2002 at 16:46 UTC
    %attrib = ( RaiseError => 1, PrintError => 0 );

    When you add \%attrib to the end of the DBI->connect statement (as is done) errors are handled by a die automatically. It saves you writing error checking code for every statement.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 21:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found