in reply to Re: Eliminating substr warnings
in thread Eliminating substr warnings

And eliminating even more temporary variables, or the need to destroy the original:
my @substrings = $string =~ /(.{1,10})/gs;

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re^3: Eliminating substr warnings
by GreyGlass (Sexton) on Aug 13, 2004 at 15:34 UTC
    Perl stuffs parens around the whole thing (with /g), according to perlop:
    my @substrings = $string =~ /.{1,10}/gs;
    Two bytes saved. 189 bytes of bandwidth used.