|Perl Monk, Perl Meditation|
How can I cleanly split a string of text into a two-dimensional arrayby vroom (Pope)
|on Oct 15, 1999 at 02:49 UTC||Need Help??|
vroom has asked for the
wisdom of the Perl Monks concerning the following question:
I want to take a long string of text and split it into a two-dimensional array of $width x $height. I know of several ways to do this but none of them are as quick and dirty as I'd like them to be? Any suggestions?
Some clarification: I want to read in the data from a bitmap say a PGM file where each 'character' is a pixel. First I'm going to break the header off the string, after that I want to split the data portion into a 2-D array of $widthx$height. I know of ways to do this but am looking for something really quick and clever.