in reply to Caught in a loop
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 ]
|
|---|