Hi folks.
I'm having strange trouble. I have a script that accesses a database via a DSN and ODBC drivers. It works fine as frogs hair if I run it from the console, but not when it's called via CGI. This may be a funky IIS configuration problem, but alas I'm the only Perl user here, so there will be no help from our web monkeys.
We're running Win2k Advanced Server, IIS 5, and the latest perl from Activestate.
Here's a snippet of where my woes come from:
use strict; use DBI; use DBD::ODBC; use CGI_Lite; my $DSN = 'BLAH'; my $dbh; open LOG, ">>log.log"; print LOG "\nTesting..\n"; $dbh=DBI->connect("dbi:ODBC:$DSN",'USER','PASSWORD',{ RaiseError => 1, AutoCommit => 1, PrintError => 0 } ); if(!$dbh){ print LOG "Error: $DBI::errstr"; exit; } print LOG "Good"; exit;
When I run this chunk of code from the console, I get a log file with:

Testing..
Good


However, if I run this from the web, I get a log file with:

Testing..

No clue here, folks. Can't for the life of me figure out why I'm not even getting an error message, which would be preferable to no message in lieu of that coveted "Good".
Any insight would be greatly apprecaited.

Thanks,
-=rev=-

In reply to IIS-CGI-DBI Errorless Errors by Reverend Phil

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.