in reply to FindBin works differently on Fedora Core 2?

This might actually be due to the version of File::Spec being used by FindBin. I see that FC2 uses version 1.5 of File::Spec::Unix, whereas Redhat 9 (Shrike) uses 1.4. Here's a subset of the diff:
< $VERSION = '1.5'; --- > $VERSION = '1.4'; > > use Cwd; 72,73c74,79 < < $self->canonpath(join('/', @_, '')); # '' because need a trailin +g '/' --- > my @args = @_; > foreach (@args) { > # append a slash to each argument unless it has one there > $_ .= "/" if $_ eq '' || substr($_,-1) ne "/"; > } > return $self->canonpath(join('', @args)); 85c91

It would appear that the trailing slash is considered more "correct" but was not functioning correctly in the older version?

At any rate, if you use the catfile() and catdir() methods from File::Spec, the dreaded '//' problem should not be an issue.

Matt

Replies are listed 'Best First'.
Re^2: FindBin works different on Fedora Core 2?
by samtregar (Abbot) on Jun 07, 2004 at 22:30 UTC
    I don't think that's correct. The copies of File::Spec on both Fedora Core 1 and Fedora Core 2 are version 0.87 (and File::Spec::Unix is 1.5 on both, which I guess must be the file you're looking at).

    Good guess though!

    -sam

      I dug a little deeper -- short anwer is that it's not FindBin, but Cwd.

      The difference seems to be when FindBin calls Cwd::abs_path(). With an argument as simple as '/tmp/', the older version (2.06 in my case) of Cwd::abs_path will chop the trailing slash, whereas the newer version from FC2 will not (Cwd version 2.12).

      So the culprit is Cwd rather than FindBin. I'll leave it to you to find the specific difference in the abs_path behavior (I think you'll see what I mean once you start digging).

      Do tell us what you find out.

      Matt

        Another excellent theory, but it's not correct either. Both my Fedora Core 1 system and Fedora Core 2 system have the same version of Cwd: 2.12. That's the version that ships with Perl 5.8.3 and they both have 5.8.3 installed. As far as I can tell they have the exact same version of all the relevent Perl modules...

        -sam