Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: String to two dimensional array

by jdporter (Paladin)
on May 07, 2008 at 12:47 UTC ( [id://685201]=note: print w/replies, xml ) Need Help??


in reply to String to two dimensional array

Yet another way, using List::MoreUtils:

use List::MoreUtils qw( natatime ); $_ = '0 X X X X X X X X 1 X X X X X X X X 2 X X X X X X X X 3 X X X X +X X X X 4 X X X X X X X X 5 X X X X X X X X 6 X X X X X X X X 7'; my @a = split; my $it = natatime(8,@a); while (my @v = $it->()) { print "@v\n"; }

Converting that into an appropriately parameterized function is an exercise left for... you. ;-)

A word spoken in Mind will reach its own level, in the objective world, by its own weight

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://685201]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-25 10:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found