#! /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"; }