[Thread moved out of p5p] On Sat, Apr 14, 2001 at 10:24:28AM -0400, Mark Mielke wrote: > On Fri, Apr 13, 2001 at 10:55:03AM -0400, "John Porter" wrote: > > Michael G Schwern wrote: > > > Fortunately these are all relatively rare... > > > last/redo/next are not rare at all, and have perfectly innocent uses. > > But the remote forms are exceedingly rare. > > Evidence that the compatibility argument is quite shallow. > > Somebody can feel free to change my thinking by providing a real live > example of where last() is preferable to use within a subroutine, outside > of any containing loop, but until they do, I find a warning, if not an > all out compile-time error, to be preferable in terms of finding bugs in > my, or someone else's code, to just allowing things to appear to work, > until some remote case in the code, where previously a loop was used, > but then the actual loop was removed, but an innocent "last" remained just > *waiting* to be executed, and causing things to break in a very unpredictable > way.... I prefer this to allowing me to program obscurely. Randal has already posted code with an example. As for a warning, that's already there! As for your argument about removing code, that's plain silly. If you remove a loop, and just manage to leave in a random line of code (how *are* you removing a loop anyway to manage to keep in a line?), that line of code could be anything, causing all kinds of havoc. Also, you have the same problem if you have a nested lexical loop, remove the inner and leave in a line of code, just waiting to be executed. No programming language is able to protect the programmer against such stupidity. And even then, if you are so afraid of making mistakes like that, enable warnings! Abigail ==== Want to unsubscribe from Fun With Perl? Well, if you insist... ==== Send email to <fwp-request@technofile.org> with message _body_ ==== unsubscribe