Natanael has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks!

Module, that I'm working on currently is almost ready for CPAN upload. However, before I do the upload, I would like to ask for it's review and maybe some critique.

Archive is available here: Test-FileReferenced-0.01.tar.gz. Packaged with Module::Build.

Some discussion to this topic: #840075.

I'm aware, that the archive may be missing some auxiliary files (like ChangeLog, TODO, README or BUGS).
They will be written shortly before the upload.

Edit:
Updated archive is here: Test-FileReferenced-0.01-RC1.tar.gz.
Updates: calls to serializer are nicely eval'ed (test will die anyway, but will do it more cleanly), module should work on more platforms (in theory at least - due to the use of File::Spec - I can't check that by my self right now).
Kudos to bluescreen for the tips.

  • Comment on New module - Test::FileReferenced - please review

Replies are listed 'Best First'.
Re: New module - Test::FileReferenced - please review
by bluescreen (Friar) on May 28, 2010 at 22:17 UTC
    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.

      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.

Re: New module - Test::FileReferenced - please review
by Khen1950fx (Canon) on May 28, 2010 at 20:57 UTC
    Not really that important, but I tidied the Makefile.PL:
    # Note: this file was auto-generated by Module::Build::Compat version +0.3607 require 5.008000; use ExtUtils::MakeMaker; WriteMakefile( 'PL_FILES' => {}, 'INSTALLDIRS' => 'site', 'NAME' => 'Test::FileReferenced', 'EXE_FILES' => [], 'VERSION_FROM' => 'lib/Test/FileReferenced.pm', 'PREREQ_PM' => { 'Test::More' => '0.94', 'Test::Exception' => '0.27', 'FindBin' => '1.47', 'YAML::Any' => '0.71', 'Cwd' => '3.2701' } );
      Thank You for the effort, but since "this file was auto-generated by Module::Build::Compat" I have not even checked it's contents.

      I'm affraid, that my attempts to clean it up every time it's re-created by Module::Build would only increase the chance of it being broken in some way or another. :(