autodie reviews

cpanratings
 

RSS | Module Info | Add a review of autodie

autodie (2.16) *****


this simple program:
perl -Mstrict -Mwarnings -e 'use autodie qw(:all); { no autodie qw(open); open(my $f,"<","pippo")} open (my $fd,"<","xxx")'

the open of file xxx not fail

perl version 5.14.2 on ubuntu 12.04 x86_64
autodie version 2.16

autodie (2.10)

I read in a lot of places that "autodie" is something that can be used in the same fashion as "use strict" or "use warnings" to catch problems. I started putting it into a lot of places and automatically adding to the top of every script. However, for something which is intended to go into every Perl script, this module is very slow to load:

****** Item 1:

-------------
use warnings;
use strict;
print "hello world.\n";
-------------

$ time perl noautodie.pl
hello world.

real 0m0.007s
user 0m0.000s
sys 0m0.008s

****** Item 2:

--------------
use warnings;
use strict;
use autodie;
print "hello world.\n";
--------------

$ time perl autodie.pl
hello world.

real 0m0.084s
user 0m0.078s
sys 0m0.005s

I don't use this module any more, because of this performance problem.

(Someone wrote to me who was worried that I thought that autodie affected the time of "print" above. In case anyone is confused, please note that "autodie" doesn't affect the time of "print", as far as I know. You can remove the "print" and still get the same sort of time results. Check the autodie documentation at the link above the review for what the module does.)

autodie (2.10) *****

autodie is great.
The code dies where it is supposed to, and not left to run into other errors

autodie (2.10) *****

I started using autodie in almost all of my applications a few months ago. It's somewhat of a mixed blessing. For existing applications, it can break things and making things less robust, solely because old code are not built with autodie in mind.

But the best thing about it is that it's lexically scoped, so for sections of code that you're not sure about, just sprinkle 'no autodie' to get the old behaviour.

It should be used on probably 95% of code out there. For the rest of the cases, where you need to report the status of each I/O operation, it's obviously more convenient to check $? instead of trapping exception everytime.

+1 for getting it into core.

autodie (2.06) ****

A great extension of Fatal.pm. For private stuff I use it very frequently. I wish it would be part of the core modules.

At work all our redhat machines use cpan2rpm'ized packages. Unfortunately autodie overwrites Fatal.pm instead of making a fork, so I can't install it because it conflicts with the system perl. A patch rt.cpan.org/Ticket/Display.html?id=49608 is underway.

autodie (1.994) *****

I use this pragma in almost all of the applications, like so:
use autodie qw( :all );
I wish that the behavior enforced by autodie were the default in Perl. With autodie, I do not have to think about testing every little open() and system(). Yes, you can test every $! and $?. But what if once in a while you forget to test? Or what if you inherit someone else's code? Are you sure all the tests are in place there? Regardless of that, such tests clutter the code and detract from the main purpose of the code.
Note that for system(), backticks (``) and exec() to work with autodie,
IPC::System::Simple module must be installed!