hai,

in my program i used the DBI module

my program running well in terminal(redhat linux 9.0)

if i use the same program in interface (use CGI) that time it shows the log error

[Mon Nov 27 20:29:35 2006] [error] [client] BEGIN failed--compilation +aborted at /home/httpd/cgi-bin/mysql_kalai/selectPdb.pl line 9. [Mon Nov 27 20:29:43 2006] [error] [client] Premature end of script he +aders: selectPdb.pl [Mon Nov 27 20:29:50 2006] [error] [client ] Premature end of script h +eaders: selectPdb.pl [Mon Nov 27 20:29:50 2006] [error] [client ] Can't locate Exporter/Hea +vy.pm in @INC (@INC contains: /usr/lib/perl5/5.8.0/i386-linux-thread- +multi /usr/lib/perl5/5.8.0 /usr/lib/perl5/site_perl/5.8.0/i386-linux- +thread-multi /usr/lib/perl5/site_perl/5.8.0 /usr/lib/perl5/site_perl +/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi /usr/lib/per +l5/vendor_perl/5.8.0 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.0/ +i386-linux-thread-multi /usr/lib/perl5/5.8.0 .) at /usr/lib/perl5/5.8 +.0/Exporter.pm line 17. [Mon Nov 27 20:29:50 2006] [error] [client] BEGIN failed--compilation +aborted at /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/D +BI.pm line 250. [Mon Nov 27 20:29:50 2006] [error] [client ] Compilation failed in req +uire at /home/httpd/cgi-bin/mysql_kalai/selectPdb.pl line 9. [Mon Nov 27 20:29:50 2006] [error] [client] BEGIN failed--compilation +aborted at /home/httpd/cgi-bin/mysql_kalai/selectPdb.pl line 9.

still i dont know what is the problem here.but the program works fine in terminal

here with i send a progam..
please help

#!/usr/bin/perl -w print "content-type:text/html\n\n"; print "<html>"; print "<head>"; print "<body>"; use CGI; $cgi=new CGI; #BEGIN { $ENV{DBI_PUREPERL} = 1 } use DBI; #::PurePerl; $pdb=$cgi->param('pdb'); $dbh=DBI->connect('dbi:mysql:mysql','kalai','kavithai') or die "connec +tion failed : $DBI::errstr"; $pdb="1une"; $query="select * from pdbsummary where pdbid='$pdb'"; $exe=$dbh->prepare($query); $exe->execute(); while(@array=$exe->fetchrow_array()) { print @array; } $exe->finish; $dbh->disconnect; print "</body>"; print "</html>"; plz help me

20061127 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips


In reply to error in perl with mysql by kalaisuresh

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.