in reply to New module - Test::FileReferenced - please review

IMHO, you should try to make this platform independent, look at File::Basename or use $^O.

here:
sub _load_reference_if_you_need { # {{{ if ($reference) { # Reference already loaded or initialized. return $reference; } # Is there a reference file? if (not -f $default_reference_filename) { # Nope. Warn the User, but don't make a tragedy of it. diag("No reference file found. All calls to is_referenced_ok W +ILL fail."); return $reference = {}; } return $reference = $serializer_load->($default_reference_filename +); }
I'd also check if you have read permissions and wrap the call to the serializer in an eval so you can catch any error in the serializer.

Replies are listed 'Best First'.
Re^2: New module - Test::FileReferenced - please review
by Natanael (Acolyte) on May 29, 2010 at 22:07 UTC

    Thank You for the hints! I applied most of them to the source, and I have a RC1 ready :)

    Permissions checking - I'll add that as a feature in 0.02, as it's a good thing for sure. However, I may not have enough time in the upcoming week, and I do not want to delay the first release.