in reply to Re^7: fall through switch/case in perl
in thread fall through switch/case in perl
As you say, it is not equivalent. To do that you need some extra checks at the top of the 'loop' ie
last unless /^\d+$/ and $_ <= 10;
It is almost certainly a silly way to do it in Perl anyway. It is even a rather suboptimal way to do it in C.....
for(i=0;i<var;i++) printf( "%c", 97+i ); /* C or perl */ print map chr,97..96+$var;
cheers
tachyon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: fall through switch/case in perl
by Aristotle (Chancellor) on Sep 07, 2004 at 03:25 UTC |