The first thing I always check when CLI works but web doesn't, is that I have my Content-Type line correct.
in reply to Re^2: Connecting to Oracle DB using DBI from CGI script
in thread Connecting to Oracle DB using DBI from CGI script
You need two newlines after it:
At least about 60% of the time for me, that fixes my main issue of not seeing anything, or rendering the page as text rather than html.
print "Content-Type: text/html\n\n";
Definitely check out marto's links, those are nice tutorials.