Subject: | Subroutines must be 'use-d'; 'use_ok' insufficient |
Am exploring the possibility of bringing IO::CaptureOutput into the Parrot distribution for
the purpose of capturing output, replacing Parrot::IO::Capture::Mini (which is essentially a
stripped-down IO::Capture). So far I have observed the following:
1. Contrary to an example from the POD, I get a syntax error if I fail to include an open
parenthesis between 'capture' and 'sub' (along with a corresponding close-paren at the end
of the statement).
2. If in a test file, I import sub foo() by wrapping it in a Test::More::use_ok test, I encounter
a "Undefined subroutine &main::foo called at ..." error. However, when I perform the import
by taking it out of the test suite, 'use foo;', that error is corrected. I suspect that is because
use_ok is a run-time operation.
To test this out, check out Parrot trunk and try to adapt t/configure/001-options.t to use
IO::CaptureOutput instead of Parrot::IO::Capture::Mini. Then compare my first passes at
using CaptureOutput here:
http://svn.perl.org/parrot/branches/capture/t/configure/001-options.t
http://svn.perl.org/parrot/branches/capture/t/configure/142-auto_aio-02.t
Jim Keenan