in reply to Getting logical path from Perl?
Does this do what you want?
$ cat /tmp/foo/mydir.pl #!/usr/bin/env perl use strict; use warnings; use Path::Tiny; my $path = path ($0); my $dir = $path->parent->stringify; print "\$0: $0\n"; print "Path::Tiny: $dir\n"; $ ls -l /tmp/foo lrwxrwxrwx. 1 user users 3 Mar 8 13:47 /tmp/foo -> bar $ /tmp/foo/mydir.pl $0: /tmp/foo/mydir.pl Path::Tiny: /tmp/foo $
🦛
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting logical path from Perl?
by mathomp4 (Novice) on Mar 09, 2021 at 13:20 UTC |