my $filepath = "OP.txt"; my $newdata = readdt2($filepath); sub readdt2 { my $ifn = shift; # how does this work open(my $IFH, "<$ifn") or die "cannot open file $ifn\n"; my $line; my @nucleotides = ("A","C","G","T"); my %ret; #why did he name a hash return?? that really confused me my @tmp; for(my $j=0;$j<4;$j++) { $ret{$nucleotides[$j]} = []; #dont understand $line = <$IFH>; chomp($line); @tmp = split(/\s+/,$line); for(my $i=0;$i<=$#tmp;$i++) { $ret{$nucleotides[$j]}->[$i]= $tmp[$i] ; #dont understand } } close($IFH); return(\%ret); }