in reply to Re: Perl 5.10.1 - compare external program output with a list of known error codes
in thread Perl 5.10.1 - compare external program output with a list of known error codes

I am getting this at the end of the perl output

Can't use an undefined value as a subroutine reference at ./error_chec +ker.pl line 34.

The line 34 is this. I actually did not understand this as well

$errors{$program_output3}; # lowercase, just in case

Replies are listed 'Best First'.
Re^3: Perl 5.10.1 - compare external program output with a list of known error codes
by stevieb (Canon) on Sep 19, 2016 at 19:17 UTC

    You missed the ->() piece, which turns it into a function call:

    $errors{$program_output3}->();

    it means, dereference $errors{$program_output3} as a CREF (code reference), and execute it.