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


in reply to Re: Re: how to rename all files in a dir
in thread how to rename all files in a dir

The real poison pill here is symlinks. Let's say you chdir to a location on your file system and read the listings there. Perl has no way of knowing if you came to that directory through 'hard' links or symlinks. And what is returned by pwd from the command line may or may not match up with what that command will return within perl.

So, the answer to your question is, you probably DO want the full path in many situations, but there is no way to automatically get there from within a script. You will usually end up putting in some code that forces Perl to use a particular directory location.

oakbox