Re: What does this error mean?

Michael Peppler <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.dbi.sybase
Message-ID <[email protected]>
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  -  [email protected]  -  http://www.peppler.org/
Sybase DBA/Developer - TeamSybase: http://www.teamsybase.com/
Sybase on Linux FAQ: http://www.peppler.org/FAQ/linux.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.