Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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.Please help.#!/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();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Bus Error (core dumped)
by Anonymous Monk on Sep 07, 2009 at 11:52 UTC | |
by Corion (Patriarch) on Sep 07, 2009 at 12:06 UTC |