in reply to Checking two scalars in Test::More $expected. It works, but is it proper?

You wrote:

use Mymodule qw( values ); use Test::More qw(no_plan); BEGIN { use_ok('Mymodule', qw( values )) };

Guess what happens if Mymodule causes an error, like returning false or dieing. Your test script will die, because it can't load Mymodule. It won't execute the use_ok test. Drop the explicit use Mymodule line and let use_ok do the work.

BTW: using Test::More without a plan is not a good plan.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Replies are listed 'Best First'.
Re^2: Checking two scalars in Test::More $expected. It works, but is it proper?
by gctaylor1 (Hermit) on Mar 29, 2009 at 18:06 UTC
    afoken, thank-you for that tip.
    That was another obvious thing that I didn't realize until you pointed it out. I wish there were some good test scripts I could look at that were not so far above my skill level. I've looked at a few from the modules I have installed but they're quite a ways above my skill level. I'm afraid if I spend the time that's needed to understand them I will have lost track of what my original project is. Which is really just learning Perl, but nonetheless I'm trying to stay focused.