in reply to File::Find, File::Spec, and full paths.

You are setting your $abspath variable incorrectly. $File::Find::name will be the relative path from the directory you are in (i.e. `pwd`) not the directory where you start looking (i.e. the first argument to your script.) Try just setting $abspath to `pwd` and chomp.

Alternatively, you could call find() with $abspath rather than $path.

-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re^2: File::Find, File::Spec, and full paths.
by Aristotle (Chancellor) on Sep 04, 2002 at 03:39 UTC
    Or rather than `pwd`, use Cwd; and then set $abspath to cwd(). That will, the documentation says, most likely do `pwd` on Unix systems. However, Cwd will work on Windows and other systems where pwd isn't available.

    Makeshifts last the longest.

Re: Re: File::Find, File::Spec, and full paths.
by mephit (Scribe) on Sep 03, 2002 at 21:07 UTC
    This seemed to do the trick. I didn't really want to use find() with an absolute path if the user specified a relative path, as I wanted the value of $name to be relative if relative was supplied on the command line. I had a strong feeling that the problem was in how I was calling rel2abs, but couldn't figure out exactly how. Thanks to all that replied.

    --

    There are 10 kinds of people -- those that understand binary, and those that don't.