in reply to Test::Prereq difficulties

Which version of Test::Prereq are you using? How are you using it? Can you post the script that you wrote using it?

I'm guessing that your command line was the following, which is a documentation error. prereq_ok() now calls plan() itself, so it doesn't need to call it on the command line too.

perl -MTest::More=tests,1 -MTest::Prereq -eprereq_ok

The fix is to just not tell Test::More anything. I've patched the docs for this and sent the new version to CPAN.

perl -MTest::More -MTest::Prereq -eprereq_ok

I'm not sure about your second problem since the error message you say yout got isn't anywhere in the current Test::Prereq sources.

--
brian d foy <bdfoy@cpan.org>

Replies are listed 'Best First'.
Re^2: Test::Prereq difficulties
by fergal (Chaplain) on Mar 04, 2005 at 23:24 UTC
    Why does it need -MTest::More on the command line? It doesn't seem to be used in the module anywhere and even if it was, you could just do use Test::More inside the module. I tried it without and it worked fine.

    While I'm at, why not add

    sub import { prereq_ok() if (caller())[1] eq '-'; }
    that way someone could just do
    perl -MTest::Prereq

    Useful module (not overkill :)

      You're right: that Test::More is superfluous. I don't know what I was thinking then, but it doesn't make sense to me anymore. I've taken that out completely and fixed up the docs.

      I like the idea of running the test if the module is used from the command line, but it feels slightly odd and anti-DWIM to me. Maybe it won't feel so weird when I upload the next version.

      Thanks :)

      --
      brian d foy <bdfoy@cpan.org>
        It is a little odd. The only other place I've seen it used was in Parse::RecDescent. At the time I didn't understand how it was doing it and just assumed it was some deep Damien magic.