Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 pondering the Monastery: (8)
As of 2014-12-22 07:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (112 votes), past polls