in reply to Duff's Device
And you can do that in Perl as well: my $n = int (($count + 7) / 8); goto (qw !LABEL0 LABEL1 LABEL2 LABEL3 LABEL4 LABEL5 LABEL6 LABEL7!) [$count % 8]; { LABEL0: print "0\n"; LABEL7: print "7\n"; LABEL6: print "6\n"; LABEL5: print "5\n"; LABEL4: print "4\n"; LABEL3: print "3\n"; LABEL2: print "2\n"; LABEL1: print "1\n"; redo if -- $n > 0; }
It's certainly legal to jump into a bare block, and bare blocks are looping constructs as well.
Abigail
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Duff's Device
by QM (Parson) on Feb 25, 2004 at 00:54 UTC |