Another example of bad syntax: the other day I tried redo within a do {} until block, but Perl complains that I could not use redo outside a loop block, which means Perl does not take do {} until as a loop block.That is documented behaviour (see perlsyn), though I must agree not very consistent. It applies not only to do {} until but also to do {} while. perlsyn suggests a workaround like this
but you have to adjust this to be able to use last.do {{ next if /^#/; # do something }} until /^\s*$/;
My suggestion is to not use those constructs altogether and instead emulate them with bare blocks and redo ...
# do {} while condition { # some code redo if condition; } # do {} until condition { # some code redo unless condition; }
-- Hofmator
In reply to Re: Re: Anon. array of refs to a range generated list of scalars.
by Hofmator
in thread Anon. array of refs to a range generated list of scalars.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |