* Ken Williams <kwilliams@cpan.org> [2013-05-13 20:15]: > Dave Mitchell <davem <at> iabyn.com> writes: > > * the serialiser documentation could state that for things to be saved > > as floats, you must do *= 1.0 shortly before saving; > > That doesn't actually work: > > % perl -MDevel::Peek -E '$x=1; print Dump $x; $x *= 1.0; $x += 0.0; > print Dump $x' > SV = IV(0x1fbe7458) at 0x1fbe7468 > REFCNT = 1 > FLAGS = (IOK,pIOK) > IV = 1 > SV = IV(0x1fbe7458) at 0x1fbe7468 > REFCNT = 1 > FLAGS = (IOK,pIOK) > IV = 1 Good point. This does: $ perl -MDevel::Peek -E '$x=1; Dump $x; $x /= 1; Dump $x' SV = IV(0x7f7fc182aab0) at 0x7f7fc182aac0 REFCNT = 1 FLAGS = (IOK,pIOK) IV = 1 SV = PVNV(0x7f7fc1802470) at 0x7f7fc182aac0 REFCNT = 1 FLAGS = (NOK,pNOK) IV = 1 NV = 1 PV = 0 -- *AUTOLOAD=*_;sub _{s/::([^:]*)$/print$1,(",$\/"," ")[defined wantarray]/e;chop;$_} &Just->another->Perl->hack; #Aristotle Pagaltzis // <http://plasmasturm.org/>Thread Previous | Thread Next