"be consistent" | |
PerlMonks |
Re: Re: sort syntaxby thelenm (Vicar) |
on Oct 16, 2003 at 19:56 UTC ( [id://299868]=note: print w/replies, xml ) | Need Help?? |
It compiles okay for me (don't know if it was changed since you posted). The }{ looks funny in the middle of the code, but it's just taking advantage of the fact that the -n flag assumes the following loop around the program as documented in perlrun:
Putting }{ in the middle of the "your program goes here" section is a Perl golf trick that I believe was invented by Eugene Van der Pijll. It makes the code before it part of the while loop, and the code afterward gets executed outside the loop. Using the -n flag causes perl to literally put the while loop around it, as you can see if you do this:
-- Mike --
In Section
Seekers of Perl Wisdom
|
|