#!/usr/bin/perl use PDL; use PDL::Matrix; $file = $ARGV[0]; open(DATA, "$file") || die "Error: Unable to open $file:$!\n"; my $d = [[],[], [], []]; while ( ) { chomp; my @1 = split(/,/); push @{$d->[0]}, $l[0]; push @{$d->[1]}, $l[1]; push @{$d->[2]}, $l[2]; push @{$d->[3]}, $l[3]; } $d = PDL::Matrix->pdl($d);