-- Ken Williams <[EMAIL PROTECTED]>

> Hi Steven,
> 
> On VMS is 'USER:[SLEMBARK.FINDBIN-LIBS-1_20]' an absolute path, i.e. is
> the SLEMBARK directory understood to be at the root of the USER volume?
> If so, probably splitpath() is actually returning the wrong result.  On
> other platforms it returns an initial empty string to indicate an
> absolute path (it's kind of an historical accident, but now that's just
> its semantics):
 
Yes. On VMS dir's referenced under a logical volume are 
absolute to that volume. 

    What is interesting is that

    my ( $vol, $bin ) = splitpath $Bin;

    my @subdirz = splitdir $bin;

    my $path = catpath $vol, catdir @subdirz, 'lib';

goes from 

    USER:[SLEMBARK.FINDBIN-LIBS-1_20]

to

    USER:[.SLEMBARK.FINDBIN-LIBS-1_20.lib]

which adds a relative path (leading '.') an input dir
that originally did not have one.

Until I use abs_path to try and resolve the logical volume
(which may be a search list) into a physical volume,
it should be opaque. 

 
> % perl -MFile::Spec::Functions=:ALL -de1
> ...
>    DB<1> x $bin = '/foo/bar/baz';
> 0  '/foo/bar/baz'
>    DB<2> x ( $vol, $dir ) = splitpath $bin;
> 0  ''
> 1  '/foo/bar/'
>    DB<3> x @subdirz = splitdir $dir;
> 0  ''
> 1  'foo'
> 2  'bar'
> 3  ''
>    DB<4> x $libdir = catdir @subdirz, 'lib';
> 0  '/foo/bar/lib'
> 
> 
> That empty string is the only clue catdir() gets that it should be
> forming an absolute path instead of a relative one.
> 
> Then we'll need to make sure catdir('', 'SLEMBARK', 'FINDBIN-LIBS-1_20',
> 'lib') returns the right result too, '[SLEMBARK.FINDBIN-LIBS-1_20.lib]'.

Then the problem was splitdir '[SLEMBARK.blah]' returning
without a leading ''.

This gives me a fix for the moment at least: I can unshift
a leading '' into @subdirz since $FindBin::Bin is always
supposed to be an absolute path.

thanx


-- 
Steven Lembark                                       85-09 90th Street
Workhorse Computing                                Woodhaven, NY 11421
[EMAIL PROTECTED]                                     1 888 359 3508

Reply via email to