in reply to Eliminating substr warnings

@substr = unpack "A$size" x ( 1 + length( $str ) / $size ), $str;

Or maybe

@substr = unpack "A$size" x POSIX::ceil( length( $str ) / $size ), $st +r;

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^2: Eliminating substr warnings
by thor (Priest) on Aug 13, 2004 at 04:29 UTC
    I find this particularly useful:
    print join ",", unpack("(A3)*", "foobarbazi"), "\n"; __END__ foo,bar,baz,i
    It doesn't work in 5.6.1, but does in 5.8.

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    With all of us waiting, your kingdom will come