in reply to Caught in a loop

Since your pseudocode isn't actually code, we can't check much for you. Missing quotes, bad syntax, partial program, etc. Are you even within a use strict; use warnings; context?

One, you are using my $job to control two nested loops. Bad form, and probably won't do what you want, unless you really know the difference between local and my. Maybe this is the cause of your hangup.

Two, instead of a goto and a generic label, you may be interested to know that perl's next accepts a label, and loop structures can be specifically labeled.

TASK: for my $task (@tasks) { my @files = get_files_for_task($task); FILE: for my $file (@files) { # whatever next TASK if file_is_bad($file); next if file_is_complete($file); # same as next FILE } }

--
[ e d @ h a l l e y . c c ]