#! /usr/bin/perl use strict; use warnings; use constant CLIENT_NICK => 'ClientNick'; use constant CLIENT_PATH => 'ClientPath'; my @array; for(my $n = 0; $n < 10; $n++) { my %result = ( CLIENT_NICK => "NICK: $n", CLIENT_PATH => "PATH: $n", ); push @array, %result; } foreach (@array) { print $_->{CLIENT_NICK} . "\n"; print $_->{CLIENT_PATH} . "\n"; } #### foreach (@array) { print "$_\n"; } #### CLIENT_PATH Path: 0 CLIENT_NICK Nick: 0 CLIENT_PATH Path: 1 CLIENT_NICK Nick: 1 ... etc