Charles Harvey <[EMAIL PROTECTED]> wrote: : : I am trying empty a directory with over 4000 files with a : script, and do not understand why I can only delete half : at a time. I am guessing that the directory handle has a : size limitation?? Is there a way to load the contents : into a large array or am I going about this all wrong? : Please forgive the newbie question. I'm trying to hack : this with my copy of the Perl Bookshelf and limited : practical experience. : : #!/usr/bin/perl : #open directory and load contents into hash : $dir = "/test/directory"; : opendir(@DIR, $dir) or die "cant opendir $dir: $!";
That should probably be DIR not @DIR. You really should use strict and turn on warnings. : while (defined($file = readdir(DIR))) { : if ($file =~ "klee") { That looks very, very wrong. You're binding a scalar to something other than a regular expression. Tell us what you are attempting to do here. HTH, Charles K. Clarkson -- Head Bottle Washer, Clarkson Energy Homes, Inc. Mobile Home Specialists 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>