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.


In reply to Re^2: Getting logical path from Perl? by mathomp4
in thread Getting logical path from Perl? by mathomp4

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.