[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Stanford IDG internal Perl style



On 2013-03-29 18:24, Russ Allbery wrote:
> * Always check the results of operations. For many functions this can
> be done with 'use autodie' at the start of a script or module.  For
> anything not covered by autodie, you should add 'or die "some error:
> $!\n"' to the end of function calls that mail fail.  For print and say,
> death checking is is provided by the Stanford::Infrared::Wrappers
> module with the functions print_fh, say_fh, print_stdout, and
> say_stdout.

Got a couple of questions about autodie usage now that I have had a time
to look at it.

What is the stance on "autodie" for non-builtins?  Would you recommend
using for subs we write ourselves (possibly by deploying "autodie
hints")[1]?
  If so, why not use it for print (etc.).  If not, why only limit it to
builtins (is it somehow flawed).

~Niels

PS: awesome typo, s/that mail fail/that may fail/  :D

[1] Limited to subs where we would otherwise use the idomatic "or
die/fail/croak" approach.  Examples include Lintian::Util's open_gz.



Reply to: