in reply to Re^3: 2 dimensional array
in thread 2 dimensional array

ok. i see what you're saying. i tried chomping the newlines after i created the table but that still doesn't work. can you suggest a way i can create the table so that it is a 2 dimensional array.

Replies are listed 'Best First'.
Re^5: 2 dimensional array
by ysth (Canon) on Jun 23, 2008 at 14:34 UTC
    Loop over the data lines from the file, after chomping them (or chomp in your loop). For each one, split it into individual characters. Just as you split on a comma with split /,/, split between characters with split //. Either add as a new row to table with push @table, [ LIST ], or just treat the uninitialized @table element as an array and it will become one: @{ $table[$row] } = ( LIST ).