Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by da w00t (Sexton)
on Dec 29, 1999 at 21:24 UTC ( #1533=note: print w/replies, xml ) Need Help??


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

would something liek this work?
#!/usr/bin/perl use Data::Dumper; open(FILE,"<xpm-pic"); $row=-1;$col=-1; while (<FILE>) { chomp; $row++; $col=-1; foreach $char (split //) { $col++;$pix[$row][$col]=$char; } } print Dumper(\@pix);
  • 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1533]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2023-12-06 04:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (29 votes). Check out past polls.

    Notices?