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

hi , i need to search for a specific file on windows and then need to have its path returned . i dont know how to do this . can someone help ?

Replies are listed 'Best First'.
Re: file search
by kyle (Abbot) on Feb 29, 2008 at 19:25 UTC
      i tried file::find , but i didnt know how to make it return the path , i need the path copied in a file .
Re: file search
by apl (Monsignor) on Feb 29, 2008 at 19:24 UTC
    Change directory to '/'.

    (A) Get a directory.

    For each entry

    • If it's a directory cd to it, and repeat from (A)
    • If it's a file, is it the one you want? (Continue, or report/stop)

    No more entries? Either go up a level and continue, or stop.

    The details are left as an exercise to the reader.

      Look at the $File::Find::name variable in the wanted() function of File::Find.
Re: file search
by ww (Archbishop) on Feb 29, 2008 at 20:24 UTC
    Then perhaps you should read perldoc File::Find which contains the answer to your original question.