A tuple is passed as a reference to a hash. The keys are the
names of the fields in the tuples. The hash values are values of
the corresponding fields in the tuple.

Tip: Because the function body is passed as an SQL
string literal to CREATE FUNCTION you
have to escape single quotes within your Perl source, either
by doubling them as shown above, or by using the extended
quoting functions (q[], qq[], qw[]).
Backslashes must be escaped by doubling them.

The new function empcomp can used
like:

SELECT name, empcomp(employee) FROM employee;

Here is an example of a function that will not work because
file system operations are not allowed for security reasons: