Join Nostr
2025-07-27 15:02:19 UTC

Jonathan Kamens 86 47 on Nostr: Every once in a while I'm just flabbergasted by how bad #Perl error-handling is, or ...

Every once in a while I'm just flabbergasted by how bad #Perl error-handling is, or at least old-style error-handling before Perl's version of exceptions started to catch on.
Like, the "messages" method of a "Mail::IMAPClient" object returns an empty list if there are no messages to fetch, but it returns undef (a scalar, not a list) if there was an error, so you can't just do "!@msgs" to check for an error, you have to do "@msgs==1&&!defined($msgs[0])". Ridiculous.
#programming