Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: How can I cleanly split a string of text into a two-dimensional array

by chromatic (Archbishop)
on Apr 01, 2000 at 10:58 UTC ( #6657=note: print w/ replies, xml ) Need Help??


in reply to How can I cleanly split a string of text into a two-dimensional array

How about:
my $data = "whatever"; my @pixels = [][]; for (my $i = 1; $i < $height; $i++) { (@pixels[$i][1 .. $width], $data) = split('', $data, $width); }
(untested)
  • Comment on Re: How can I cleanly split a string of text into a two-dimensional array
  • Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2016-06-27 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred method of making French fries (chips) is in a ...











    Results (337 votes). Check out past polls.