While unsure about what is going on, i must admit that was a totally unexpected result

i was wondering if you had run into something called a dualvar.

use strict; use warnings; $|=1; use Scalar::Util qw(dualvar); use Devel::Peek; print "nv1\n"; my $nv1 = 1e-2 ;Dump($nv1); print "nv1: +$nv1 ".($nv1+0)."\n"; Dump($nv1); print "dv2\n"; my $dv2 = dualvar( 1e-2, "hi" );Dump($dv2); print "dv2: +$dv2 ".($dv2+0)."\n"; Dump($dv2);
Result
nv1 SV = NV(0xa7c024) at 0xa3e614 REFCNT = 1 FLAGS = (PADMY,NOK,pNOK) NV = 0.01 nv1:0.01 0.01 SV = PVNV(0x3f7364) at 0xa3e614 REFCNT = 1 FLAGS = (PADMY,NOK,pIOK,pNOK) IV = 0 NV = 0.01 PV = 0xa959d4 "0.01"\0 CUR = 4 LEN = 36 dv2 SV = PVNV(0x3f73c4) at 0xa8facc REFCNT = 1 FLAGS = (PADMY,NOK,POK,pNOK,pPOK) IV = 0 NV = 0.01 PV = 0xa45c5c "hi"\0 CUR = 2 LEN = 10 dv2:hi 0.01 SV = PVNV(0x3f73c4) at 0xa8facc REFCNT = 1 FLAGS = (PADMY,NOK,POK,pIOK,pNOK,pPOK) IV = 0 NV = 0.01 PV = 0xa45c5c "hi"\0 CUR = 2 LEN = 10
Of particular interest here is the line "dv2:hi 0.01" where in string context you get hi, but in numeric you get 0.1. But it doesnt seem that dualvars are your problem.


In reply to Re^3: Problems with values expressed in scientific notation not being returned through DBI by huck
in thread Problems with values expressed in scientific notation not being returned through DBI by DazedConfuzed

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.