Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Currently i am using the following to get allthe header files in the cwd,this only gives the filenames,how can I change it to get the absolute paths of the header instead of just the file names?

find(sub { push @headers, "$_\n" if -f && /\.h$/ && !$seen{$_}++; }, ".");

Replies are listed 'Best First'.
Re: How to get absolute header paths
by atcroft (Abbot) on Apr 08, 2011 at 05:47 UTC

    Have you tried using $File::Find::name in place of $_ ?

    Hope that helps.

Re: How to get absolute header paths
by cdarke (Prior) on Apr 08, 2011 at 08:45 UTC
    Alternatively see Cwd and use Cwd 'abs_path';

    By the way, if you are using a module (like File::Find) could you please indicate that that is the case? For example the use or require statement would help, otherwise we have to guess.