I want my test files to be able to find the modules they're testing
just using their relative locations, given the usual layout of "lib"
and "t" locations in parallel inside the project directory.

I find that while this works:

    use lib $*PROGRAM.parent.add('../lib');

This doesn't work:

    my $lib_loc = $*PROGRAM.parent.add('../lib');
    use lib "$lib_loc";

I get a compile time error

    Use of uninitialized value $lib_loc of type Any in string context.
    ...
    Repository specification can not be an empty string.  Did you mean
'use lib "."' ?

I thought that this would fix the problem, but I see the same
compile time error with it:

    BEGIN {
      my $lib_loc = $*PROGRAM.parent.add('../lib');
      use lib "$lib_loc";
    }

Does that make sense to anyone?  It feels like a bug to me.

Reply via email to