in reply to Re^2: is split suppose to drop 0's from strings?
in thread is split suppose to drop 0's from strings?
Not as numerically accurate, but when doing dev/debug, easier on the eyes. I hoped it wasn't due to undef detection, but it had nothing to do w/that:perl -e 'my @a=(1/3, 1/4, 1/5, 1/6, 1/7); print "[".join(", ",@a)."]\n"' [0.333333333333333, 0.25, 0.2, 0.166666666666667, 0.142857142857143] ----------- vs. -------------- > perl -e 'use P;my @a=(1/3, 1/4, 1/5, 1/6, 1/7); P "%s", \@a;' [0.33, 0.25, 0.20, 0.17, 0.14]
As usual, thanks pointing me in the right direction!> perl -e 'use P;my @a=(1/3, 1/4, $x, 1/6, 1/7); P "%s", \@a;' [0.33, 0.25, (undef), 0.17, 0.14]
|
|---|