#!/usr/bin/perl use strict; use warnings; my @list; open(my $fh, '<', $file) or die("Unable to open file \"$file\": $!\n"); while (<$fh>) { push @list, [split/s+/]; }