Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Module::Install has a pretty simple idea of whether you're the author. If an ./inc directory doesn't exist when you run the Makefile.PL, one is created, and all the required Module::Install code it put into it. Then, a directory is created called ./inc/author. If that directory exists, you're the author. If it doesn't -- because ./inc existed already when you ran the Makefile.PL, because you got the whole thing in a tarball from the CPAN -- then you are not the author.

    WTF?? I must have a different idea than you of what constitutes a simple test, then. Way too much voodoo!

    I'd rather try something like this: if you're a CPAN author, you set an environment variable with your CPAN ID. For example, for you, you'd set it to "RJBS". At the time to run the tests, this author testing module test to see if $ENV{CPAN_ID} is set, and if it is, see if it's set to the name of the author of this particular module. Only then, you will be considered to be the module author, for this mo

    • At the time to run the tests, this author testing module test to see if $ENV{CPAN_ID} is set

      Personally, I prefer to have all my modules listed in TEST_AUTHOR (E.g., export TEST_AUTHOR=My::Module,My::Other::Module), and have the check be

      if ( grep { $_ eq 'My::Module' } split ',' => $ENV{TEST_AUTHOR} ) {

      That way, I have only one environment variable to take about, and it's not tied to me but rather to the modules of interest.