Here is an example of very slight side effect of using Test::More
in test suite, which I had trouble with today.

  package Bareword::Freaks;
  
  sub foobar {
      require Carp;
      Carp::croak 'blah';
  }
  
  1;

This will be a compile error:

  String found where operator expected at - line 5, near "Carp::croak 'blah'"
        (Do you need to predeclare Carp::croak?) 


But, the following test couldn't detect it: It compiles okay.

  use strict;
  use Test::More tests => 1;
  BEGIN { use_ok 'Bareword::Freaks'; }


It is because Test::More use()s Carp, thus defines Carp::croak at
compile time before loading Bareword::Freaks. Duh.


--
Tatsuhiko Miyagawa <[EMAIL PROTECTED]>

Reply via email to