Re: DBD::ODBC fetch is returning string for integer

[email protected]
Newsgroups gmane.comp.lang.perl.modules.dbi.general
Message-ID <[email protected]>
> DBD::ODBC is returning strings for integers.  This results in incorrect values
> for  bit wise operators.  (for ex:- $e='16'; $f = '32'  print $e & $f returns
> 12 instead of zero ). Is there a setting that can help us return integers as
> 'integers'.

It's safer (and easier) to make your perl code independent of the returned
data type:

 $e='16';
 $f='32';
 print $e&$f; # prints '12'
 $e += 0; $f += 0;
 print $e&$f; # prints '0'


--      Peter Vanroose.
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.