http://qs1969.pair.com?node_id=1156429


in reply to Re: How to determine absolute path of current Perl file?
in thread How to determine absolute path of current Perl file?

Hi Discipulus! Thanks for your reply. My understanding is that Cwd::abs_path() uses the current directory, but that directory may not be equal to the initial current directory (for example if the user has called chdir). Regarding Module::Path, yes it could work.. but not all perl files are modules, for example the main script ./test/test.pl. Also I think there is no reason to cycle all the @INC directories for the given module, when it always (if the path is relative) will be under (that is, relative to) the initial current directory.