print "$_->[0]\n" for @arrayrefs # or map may be your friend print "servers: ", (join ", ", map {$_->[0]} @arrayrefs), "\n";