Reviews by particle

cpanratings
 

RSS

Config-IniFiles (2.52) **

documentation is imprecise, and does not take into account edge cases. api is designed to return undef, even in list context, rather than (). test suite is far from complete. bugs exist when using IO::File objects, and they're completely untested.

Attempt (1.01) ***

the documentation is consise, as is the code this module provides.

unfortunately, there are bugs in the way delays and retries are handled. this is a classic bug--checking for existance of a key in a hash, without checking whether the value is valid.

here's an example, from the attempt subroutine:

# sleep if we need to

select undef, undef, undef, $args{delay}

if exists $args{delay};

if the delay key exists in the args hash, the select statement is run. but if the value of $args{delay} is undefined, select hangs. whoops!

checking whether the value is defined, and can be properly evaluated by select in numeric context would fix this problem.

similarly, this code

# find out how many attempts we're going to take,

# defaulting to two.

my $tries = exists($args{tries}) ? $args{tries} : 2;

will set $tries to undef if the key exists but is undefined. the same checks mentioned above would fix this problem as well.

overall, this module provides a subroutine that offers great benefits without getting in the way. i look forward to more tests, and bug fixes which will make this bulletproof, production-ready code.