in reply to fixed length string

YAW.

print "'", pack( 'A5', $_ ), "'" for qw[ so some somewhat ]; 'so ' 'some ' 'somew'

Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algoritm, algorithm on the code side." - tachyon

Replies are listed 'Best First'.
Re^2: fixed length string
by keszler (Priest) on Jul 05, 2004 at 11:06 UTC
    Pack truncates as well as pads. (Mental note: caffeinate before posting.)

    Rate srchrep xprintf YAW srchrep 5434/s -- -79% -82% xprintf 25870/s 376% -- -16% YAW 30876/s 468% 19% --