Hi monks

I am fetching a record from a mysql database. if I run the code on Perl v5.6.2, code runs fine and fetches it. But if I am running on Perl v5.8.8, code thorws error - "Bus Error (core dumped)"

This is the code I am using.
#!/usr/bin/perl # PERL MODULES use DBI; use DBD::mysql; # HTTP HEADER print "Content-type: text/html \n\n"; # CONFIG VARIABLES $platform = "mysql"; $database = "TEST"; $host = "127.0.0.1"; $port = "3306"; $tablename = "SERVICE"; $user = "guest"; $pw = "guest"; #DATA SOURCE NAME $dsn = "dbi:mysql:$database:$host:3306"; # PERL DBI CONNECT $DBIconnect = DBI->connect($dsn, $user, $pw); #my $sth = $DBIconnect->prepare(qq{select serviceprovider from PROVSER +VICE limit 1}); my $sth = $DBIconnect->prepare(qq{SELECT COUNT(*) col FROM dual WHERE +1=1}); $sth->execute(); my $ss = $sth->fetchrow(); print $ss; print "\n"; $sth->finish(); $DBIconnect->disconnect();
Please help.

In reply to Bus Error (core dumped) by Anonymous Monk

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.