use strict; open my $fh, '<', 'file' or die "file: $!\n"; my @data; while (<$fh>){ chomp; push @data, [split /,/]; }