in reply to Re: Perl file operations
in thread Perl file operations

While I don't have a directory with 60,000 files in it to test your code I would guess that <*.txt> is creating such a large list that it runs out of memory.

At an estimate of 64 bytes of overhead per SV, 60,000 strings produced by that list will take up 3.6 megabytes of memory, not counting the lengths of the filenames.

Replies are listed 'Best First'.
Re^3: Perl file operations
by SkullOne (Acolyte) on Feb 23, 2008 at 05:54 UTC
    Monks,
    I am stupid. The file extensions in the directory were different that I was expecting.
    I fixed the file extension, and it slowly but surely processed the 60,000+ files into their respective directories. I watched memory usage on the successfull run, and it hovered between 60 and 70 megabytes, using Activeperl.
    Please dont harm me :(
      We'll hold off on the crucifixion.