Just incase I totally confused you :)
use strict;
use vars qw/$path/;
BEGIN { $path = "/foo/bar" };
use lib $path;
print "Content-type: text/plain\n\n";
print join "\n", @INC;
Code:
#!/usr/bin/perl use strict;
use vars qw/$path/;
BEGIN { $path = "/foo/bar" };
use lib $path;
print "Content-type: text/plain\n\n";
print join "\n", @INC;