my $myfile = "BigOldFile.psv"; ## pipe-separated values :) open(MYFILE, $myfile) or die "Could not open $myfile: $!\n"; my @lines = []; while() { chomp; push @lines, [split(/\|/, $_, -1)]; } ## This will show you the format: my $line=1; for (@lines) { print "Line $line: $_\n"; for (@$_) { print "*$_*\n"; ## Stars are to demonstrate null values } $line++; }