Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Welcome to the Monastery
 
PerlMonks  

Re: Caught in a loop

by cbrandtbuffalo (Deacon)
on Oct 14, 2005 at 11:57 UTC ( [id://500274]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Caught in a loop

I don't know if it will solve your problem or not, but for the type of thing you're doing I would think a 'while' would be more appropriate. I tend to think of 'for' loops as being more deterministic, and your situation is more open ended. So maybe something like:
while(1) { begining: print "A\n"; while (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 while (my $job = read_dir(G:/Output")) { print "D\n";
I'm interested to hear from some other monks.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://500274]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.