1# NAME
2
3Test::use::ok - Alternative to Test::More::use_ok
4
5# SYNOPSIS
6
7    use ok 'Some::Module';
8
9# DESCRIPTION
10
11According to the __Test::More__ documentation, it is recommended to run
12`use_ok()` inside a `BEGIN` block, so functions are exported at
13compile-time and prototypes are properly honored.
14
15That is, instead of writing this:
16
17    use_ok( 'Some::Module' );
18    use_ok( 'Other::Module' );
19
20One should write this:
21
22    BEGIN { use_ok( 'Some::Module' ); }
23    BEGIN { use_ok( 'Other::Module' ); }
24
25However, people often either forget to add `BEGIN`, or mistakenly group
26`use_ok` with other tests in a single `BEGIN` block, which can create subtle
27differences in execution order.
28
29With this module, simply change all `use_ok` in test scripts to `use ok`,
30and they will be executed at `BEGIN` time.  The explicit space after `use`
31makes it clear that this is a single compile-time action.
32
33# SEE ALSO
34
35[Test::More](http://search.cpan.org/perldoc?Test::More)
36
37# CC0 1.0 Universal
38
39To the extent possible under law, 唐鳳 has waived all copyright and related
40or neighboring rights to L<Test-use-ok>.
41
42This work is published from Taiwan.
43
44[http://creativecommons.org/publicdomain/zero/1.0](http://creativecommons.org/publicdomain/zero/1.0)