in reply to Re: Length of float using printf
in thread Length of float using printf

"A" works with characters since 5.10. (It still works with bytes, being a subset of characters.)
>perl588\bin\perl -MTest::More=no_plan -e"$s=join '', map chr, 0x2660. +.0x2666; is(unpack('A4',$s), substr($s,0,4))" not ok 1 [...] 1..1 # Looks like you failed 1 test of 1. >perl589\bin\perl -MTest::More=no_plan -e"$s=join '', map chr, 0x2660. +.0x2666; is(unpack('A4',$s), substr($s,0,4))" not ok 1 [...] 1..1 # Looks like you failed 1 test of 1. >perl5100\bin\perl -MTest::More=no_plan -e"$s=join '', map chr, 0x2660 +..0x2666; is(unpack('A4',$s), substr($s,0,4))" ok 1 1..1

Replies are listed 'Best First'.
Re^3: Length of float using printf
by vinaynp (Initiate) on Jun 02, 2009 at 19:10 UTC
    So, I have decided to implement the substr and change the way my application uses it. Thanks again for all the inputs.