Win has asked for the wisdom of the Perl Monks concerning the following question:
This program runs in the background of my PC and picks up request files and then runs with them. But occassionally it will get caught in a loop at the stage where it says print 'B'; It will then pull out of the loop and continue as before only when I press Control-C at the DOS prompt. I am wondering whether the solution to this problem is to say 'when you have checked all the files' GOTO beginning: ? Does anyone have any suggestions about what is causing this and how best it can be fixed?for(;;) { begining: print "A\n"; foreach my $job (read_dir("G:/Input")) { print "B\n"; next unless $job =~ /(.{1,36})\.txt$/; my $tag = $1; ##'when you have checked all the files' GOTO beginning foreach my $job (read_dir(G:/Output")) { print "D\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Caught in a loop
by halley (Prior) on Oct 14, 2005 at 16:12 UTC | |
|
Re: Caught in a loop
by cbrandtbuffalo (Deacon) on Oct 14, 2005 at 15:57 UTC | |
|
Re: Caught in a loop
by 5mi11er (Deacon) on Oct 14, 2005 at 16:01 UTC | |
|
Re: Caught in a loop
by graff (Chancellor) on Oct 15, 2005 at 15:56 UTC |