in reply to Re: Anon. array of refs to a range generated list of scalars.
in thread Anon. array of refs to a range generated list of scalars.
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Anon. array of refs to a range generated list of scalars.
by Aristotle (Chancellor) on Jan 18, 2003 at 20:01 UTC | |
by Hofmator (Curate) on Jan 18, 2003 at 20:31 UTC | |
by Aristotle (Chancellor) on Jan 18, 2003 at 20:54 UTC |