I wouldn't write code this way but the user's example had not used the CGI module and had already put out the http header. The original poster wanted to know how to find out what went wrong so I plugged an [unfortunately broken] example of how to find out into his code. I guess I could have gone on to give a couple of pointers on better ways to structure his web apps and rewritten his entire snippet for him but I thought he's already having problems with DBI, why confuse him with talk about CGI? Hopefully, he'll get there when he's ready for it.
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link
or How to display code and escape characters
are good places to start.