Skip Menu |

This queue is for tickets about the Dir-Self CPAN distribution.

Report information
The Basics
Id: 130680
Status: new
Priority: 0/
Queue: Dir-Self

People
Owner: Nobody in particular
Requestors: DBOOK [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Wrong result if current file has been referred by a symlink
If the current file (importing Dir::Self) was loaded via a symlink, its filename returned by caller() will be that of the symlink, and thus the directory containing the symlink will be returned instead of the directory containing the source file. It's more likely the latter would be the desired result for consistency. This can't be fixed after the fact, to fix it Cwd::abs_path could be applied to $file before splitpath to resolve symlinks. abs_path has portability issues, but as far as I know, only when the file does not exist or has permissions issues, which shouldn't occur while a source file is being successfully read, but logic may need to be added so `-` and `-e` as the filename (source code from STDIN and -e) don't blow up.