#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $file='tst.csv'; my @data; open(my $fh, '<', $file) or die("error open $file ($!)\n"); while(my $line=<$fh>) { chomp($line); my @elements=split(/\s+/,$line); push(@data,\@elements); } close($fh); print Dumper(\@data);