in reply to Re: check if it is a file or directory
in thread check if it is a file or directory

I tought to use a while, because my directory has really a lot of files, so with a while loop was easy to run that program again, also if it fails. If File::Slurp reads all files at once, and it pocesses them later, maybe my program crashes. Please let me know if Slurp acts in that way, or there is some control on directory reading. For that same reason I choose a "while" over any entries and not a "foreach" structure. For that I can understand, "foreach" read all the lines and then process it, but the "while" process all the lines, while reading. Thank you
  • Comment on Re^2: check if it is a file or directory

Replies are listed 'Best First'.
Re^3: check if it is a file or directory
by toolic (Bishop) on Feb 26, 2010 at 15:54 UTC
    File::Slurp will read all directory contents (files and sub-directories) at once. Because your requirement is to process each file one at a time, do not use File::Slurp in this case.
      ok, thank you for your answer!