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
, or just treat the uninitialized @table element as an array and it will become one: