Help for this page

Select Code to Download


  1. or download this
    my @matrix;
    while( <> ) {
    ...
        push @matrix, [ split /\s*,\s*/, $_ ];
    }
    # Now @matrix is an array of array references.
    
  2. or download this
    my @matrix = map { chomp; [ split /\s*,\s*/, $_ ] } <>;