Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: String to two dimensional array

by pc88mxer (Vicar)
on May 06, 2008 at 23:40 UTC ( [id://685097]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $text = "0 X X X ...";
    my @items = split(' ', $text);
    ...
      push(@array, [ splice(@items, 0, 8) ]);
    }
    pp \@array; use Data::Dumper;
    
  2. or download this
    die "incomplete last row\n"
       unless (scalar(@{$array[-1]} == 8);
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2024-04-25 20:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found