On Sep 18, Bob Showalter said:

>Stephen Hardisty wrote:
>> > for(split(/(..)/, $string)) { print "*$_" if $_; }
>>
>> Gorgeous :o)
>
>@parts = grep length, split /(..)/, $string;

WHY are we using split() for this?  Why are we using a method that returns
a list twice the size that we want, that we then have to filter through?

  @parts = $string =~ /.{1,$len}/sg;

and you're done.

-- 
Jeff "japhy" Pinyan      [EMAIL PROTECTED]      http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
<stu> what does y/// stand for?  <tenderpuss> why, yansliterate of course.
[  I'm looking for programming work.  If you like my work, let me know.  ]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to