#!/usr/bin/perl use strict; use warnings; use constant STATUS => 0; use constant REQUEST => 1; # Some code that initializes %list # In the form # $list{ $nas }[STATUS] = $response_status; # $list{ $nas }[REQUEST] = $request_date_time # Later on you can retrieve the status and request like my $mac = ''; # actual code to get MAC from log my $status = $list{ $mac }[STATUS]; my $request = $list{ $mac }[REQUEST];