#!/usr/bin/perl -w use strict; use warnings; # create array ref and count my $matrix=(); my $i=0; open PROFILES, 'profile/profile.db' or die $!; while () { chomp; # add array as array ref to array ref @{$matrix->[$i]} = split /\t/; $i++; } close(PROFILES); # access referenced data like this print $matrix->[1]->[6]; # (7th element of 2nd row generally :) # should start at 0,0 exit(0);