#!/usr/bin/perl use strict; use warnings; my (@Cdevices,@Mdevices); push (@Cdevices, 'UnitID', 'fileno'); push (@Mdevices, \@Cdevices); # this will show us the actual layout of the array use Data::Dumper; print Dumper(\@Mdevices); # $k=0; $k<=$#Mdevices; $k++ is C-style. Possible, but unnecessary overhead for my $ref (@Mdevices) { print join(' - ', @{$ref}),"\n"; }