#!/usr/bin/perl use strict; use warnings; my @data; open(DAT, '<', 'test.txt') or die $!; while() { chomp; push @data, [ split( /,/ ) ]; } close(DAT); for my $row ( 0 .. $#data ) { # iterate over each row by index for my $column ( 0 .. $#{$data[$row]} ) { # iterate over each column by index print "row $row, column $column: $data[$row][$column]\n"; # display using the notation from the Arrow Rule } } # now let's just print the data in the 1st row, 1st column (zero based of course) print $data[1][1],"\n"; # valid, see above print $data[1]->[1],"\n"; # also valid, Rule 2 print ${$data[1]}[1],"\n"; # also valid, Rule 1