develooper Front page | perl.beginners | Postings from October 2009

Re: split n characters into n chunks

Thread Previous | Thread Next
From:
Dr.Ruud
Date:
October 27, 2009 01:31
Subject:
Re: split n characters into n chunks
Message ID:
20091026182802.11344.qmail@lists.develooper.com
Shawn H Corey wrote:
> Dr.Ruud wrote:

>>   push @list, unpack "x${_}a$size", $word for 0 .. $max;
>>
>> Funnily enough, that is somehow&what faster than
>>
>>   push @list, map unpack( "x${_}a$size", $word ), 0 .. $max;
> 
> You don't need the push:
> 
>   my @list = map unpack( "x${_}a$size", $word ), 0 .. $max;

Yes, been there, and was also slower.
:)

-- 
Ruud

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About