for loop - Perl programming: continue block -


i have started learning perl scripting language , have question.

in perl, logical reason having continue block work while , do while loops, not for loop?

you can use continue block everywhere makes sense: while, until , foreach loops, 'basic' blocks -- blocks aren't part of statement. note can use keyword for instead of foreach list iteration construct, , of course can have continue block in case.

as else said, for (;;) loops have continue part -- 1 want execute first?

continue blocks don't work do { ... } while ... because syntactically that's different thing (do builtin function taking block argument, , while part statement modifier). suppose use double curly construct them (basic block inside argument block), if had to:

do {     {         ...;         continue if $bad;         ...;     }     continue {         ...; # clean     } } while $more; 

Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -