Reviews by Timur Shtatland

cpanratings
 

RSS

File-Temp (0.22) *****

Nice and useful module for creating and cleaning up temporary files, safely. It provides an interface to return the filename, the filehandle, or both together. Why reinvent the wheel with your own temp file names created from $$ or whatever? Just use File::Temp!

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!

Data-Dumper (2.121) *****

Data::Dumper is a great debugging tool! I use this module very frequently. It is part of my application template. In my editor I use a key binding with a macro to insert the diagnostic "carp...Dump" statements in the parts of code where I need it. To enable 'ctrl-c g' insert the diagnostic statements, my '~/.emacs' file has:

(global-set-key "\C-cg" 'perl-insert-diagnostics)

(defun perl-insert-diagnostics ()

"Insert 'carp...Data::Dumper'"

(interactive)

(insert "if ( $self->{verbose} > 2 ) {")

(cperl-indent-command)

(insert "\n")

(insert "carp( Data::Dumper->Dump( [$self], ['self'] ) );")

(cperl-indent-command)

(insert "\n")

(insert "}")

(cperl-indent-command)

(insert "\n")

(cperl-indent-command)
)

Regexp-DefaultFlags (0.01) *****

Great module! I use it very frequently. 'use Regexp::DefaultFlags' is part of my application template. I wish these flags were the defaults in Perl to begin with...