1 According to the Test::More documentation, it is recommended to run
2 use_ok() inside a BEGIN block, so functions are exported at
3 compile-time and prototypes are properly honored.
5 That is, instead of writing this:
7 use_ok( 'Some::Module' );
8 use_ok( 'Other::Module' );
10 One should write this:
12 BEGIN { use_ok( 'Some::Module' ); }
13 BEGIN { use_ok( 'Other::Module' ); }
15 However, people often either forget to add BEGIN, or mistakenly group
16 use_ok with other tests in a single BEGIN block, which can create subtle
17 differences in execution order.
19 With this module, simply change all use_ok in test scripts to use ok,
20 and they will be executed at BEGIN time. The explicit space after use
21 makes it clear that this is a single compile-time action.