$anon_array_ref = ['one', 'two', 'three']; @md_array = ( ['one', 'two', 'three'], ['four', 'five', 'six' ], # ...etc... ); print "Yep.\n" if($md_array[0][1] eq 'two'); my @data; for my $file (map "$_.dat", @cat) { open(my $fh, "< $file") or die "can't open $file: $!\n"; push @data, [<$fh>]; close $fh or die "can't close $file: $!\n"; } print $data[0][0];