PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: What does this error mean?
Date: Nov 23 2005 4:56PM

On Wed, 2005-11-23 at 10:49 -0500, Lin, Arthur wrote:
> 
> All of a sudden I'm getting this error on my server.
> Please let me know what the cause to this type of error then I can bark
> at right tree.
> Thanks in advance.  And happy holiday to every body !!!
> 
> Can't coerce array into hash at
> /opt/perl-5.6.1/lib/site_perl/5.6.1/sun4-solaris
> /Sybase/CTlib.pm line 932.  

It would appear to come from this code:

        while ($data = $db->ct_fetch($flag, 1)) {
            if (defined $sub) {
		if($flag) {
		    &$sub(%$data);
		} else {
		    &$sub(@$data);
		}
            } else {
		if($flag) {
		    push(@res, {%$data});   # <---- here??
		} else {
		    push(@res, [@$data]);
		}
            }

in the ct_sql() function. My guess is that there is some confusion
internally in perl here, maybe because the $data value doesn't have an
even number of elements?

It would help to see the query that generates this, and the source perl
code maybe, and ideally some output...

Michael
-- 
Michael Peppler  -  mpeppler@peppler.org  -  http://www.peppler.org/
Sybase DBA/Developer - TeamSybase: http://www.teamsybase.com/
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html