Perl lets you have a trailing-comma, as I do in my call to errors(), for the pure-and-simple reason that it's a bit easier to add new stuff after it as you revise the program. The hash as-shown contains two keys, not three.

I enclose the hash-keys in quotes, vs. the so-called “barewords.”

To me, the use of use strict; use warnings; is obligatory.

In the snippet of code defining errors() itself, $$args{'foo'} is a shorthand for $args->{'foo'} that I happen to prefer.

In this example, the first (and only) argument to the subroutine is “a reference to a hash,” otherwise known simply as a “hashref.” Perl uses the notion of a “ref” quite extensively, allowing you to build up arbitrarily complex data structures.