On Sat, Feb 17, 2001 at 03:10:30PM -0500, [EMAIL PROTECTED] wrote:
> Dangerous. Take Test.pm for instance. It expects certain tests to be
> on certain lines because it reads back its own error messages.
>
>
> Ok, two birds with one stone. Define t/TestSetup.pm as:
>
> chdir 't' if -d 't';
> @INC = '../lib';
>
> And then have TEST run all tests with "perl -MTestSetup"!
Be very careful--part of the goal is to make sure you don't get
settings from an installed perl, and the above could pull in
TestSetup from an installed perl. That will be ok--until the
semantics of TestSetup change!
I once wrote a module called init.pm that took a Perl file to "do",
so you could run
perl -Minit=startup.pl script
and startup.pl would be executed first. If the semantics of init.pm
were frozen, this mechanism could be used, and it wouldn't matter
whether init.pm came from an installed perl, or the source tree.
init.pm looks something like
sub import { do "$_[1]"; die $@ if $@ }
Andrew
PS. perl-qa looks like it goes to p5p, but if it doesn't, cc: me on
replies.