in reply to Re: Re: Can't use an undefined value as a HASH reference
in thread Can't use an undefined value as a HASH reference

Now I'm checking the employeeid from a hash and the userid and setting $ok to 1 if the two values are equal. Then I check ok and when I do the script dies on that line with "Can't use an undefined value as a HASH reference at /usr/local/www/cgi-bin/kapc/md2/display_md_calendar.cgi line 1570."

Here is the code.

my $value1 = int(%{@{$no_call_requested_days->{$today_int}}[$i]}->{'em +ployee_id'}); my $value2 = int($user_id); my $ok == (length($value1) == length($value2)) ? (1) : (0); if ($ok == 1) { for ($j=0; $j<length($value1); $j++) { if (substr($value1, $j, 1) != substr($value2, $j, 1)) { $ok = 0; } } } if ($ok == 1) # SCRIPT DIES HERE {