zoryn has asked for the wisdom of the Perl Monks concerning the following question:
I use "foreach $FILE (@files)" to read all the files from a certain directory. Now, inside this for, I call a "system" command, and when I control+C inside that command, I jump out of the foreach loop.
The problem now is, after jumping out, the directory is slightly altered, files have been moved, but if I do another foreach after the 1st one, it only sees the files that were there BEFORE the 1st foreach.
I think that sounded a little confusing, but here's the meat: I have 2 files, I enter the 1st foreach, inside it I move one of them. I jump out of the 1st foreach, then when entering the 2nd it still sees 2 files, when there's only one there.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem reading files from directory
by shigetsu (Hermit) on Jul 20, 2007 at 18:48 UTC | |
by zoryn (Initiate) on Jul 20, 2007 at 19:00 UTC | |
by shigetsu (Hermit) on Jul 20, 2007 at 19:38 UTC | |
by yaneurabeya (Novice) on Jul 20, 2007 at 20:07 UTC | |
by zoryn (Initiate) on Jul 20, 2007 at 21:05 UTC | |
|
Re: Problem reading files from directory
by TOD (Friar) on Jul 21, 2007 at 02:11 UTC | |
by TOD (Friar) on Jul 21, 2007 at 02:24 UTC | |
|
Re: Problem reading files from directory
by mjscott2702 (Pilgrim) on Jul 23, 2007 at 21:23 UTC |