use Data::Dumper; # Just grabbing the values of these so that # strict will cope with them. my $my_today_int = $today_int; my $my_no_call_requested_days = $no_call_requested_days; my $my_i = $i; my $my_user_id = $user_id; print STDERR Dumper($my_today_int, $my_i, $my_user_id); print STDERR Dumper($my_no_call_requested_days); { use strict; my @today = @{$my_no_call_requested_days->{$my_today_int}}; print STDERR "today:\n", Dumper(@today); my $ref = $today[$my_i]; print STDERR "ref:\n", Dumper($ref); my $employee_id = $ref->{'employee_id'}; print STDERR "employee_id: [$employee_id]\n"; if($employee_id eq $my_user_id) # should be "==" { print "They are the same!\n"; } }