http://www.perlmonks.org?node_id=744526


in reply to FindBin is broken (RE: How do I get the full path to the script executing?)
in thread How do I get the full path to the script executing?

Looking around for a solution to the above problem I found:
use Cwd 'abs_path'; my $scriptpath = abs_path($0);
..but then of course I explicitly wanted to follow any symlinks, so that I could place script & data in the same separate directory, put a symlink to the script in my $PATH, and have the script dig figure out where to read its data by following that link.

See also: