The issue with pwd -L is that we don't always run these scripts from the bindir. So, we'd have to chdir to do so and:
$ cat /discover/nobackup/mathomp4/MyTestScript/bin/test-pwd.pl
#!/usr/bin/env perl
use FindBin;
use File::Basename;
my $fvroot = dirname($FindBin::Bin);
print "Using Bin: $fvroot\n";
my $fvroot2 = dirname($FindBin::RealBin);
print "Using RealBin: $fvroot2\n";
chomp($pwdL = `pwd -L`);
print "Current pwd -L: $pwdL\n";
chdir($fvroot);
chomp($pwdL2 = `pwd -L`);
print "After pwd -L: $pwdL2\n"
$ /discover/nobackup/mathomp4/MyTestScript/bin/test-pwd.pl
Using Bin: /gpfsm/dnb44/mathomp4/MyTestScript
Using RealBin: /gpfsm/dnb44/mathomp4/MyTestScript
Current pwd -L: /home/mathomp4
After pwd -L: /gpfsm/dnb44/mathomp4/MyTestScript
So, it's not logical because the chdir didn't go to the logical path! That said, I haven't yet tested the Path::Tiny yet. |