Originally the accepted way in Perl to signal an error was to return undef and let the users of the function or module decide what they want to do with it. If they even look at it.

In other languages throwing an exception is the standard way to signal an error.

Some of the Perl modules on CPAN follow the "return undef" path, others will throw an exception. The question how to deal with that?