in reply to Re: Re: Re: Basic arithmetic functions
in thread Basic arithmetic functions
Is this documented behavior? or an unintenional artifact of the way the parser deals with -n ?
Both. :-) (But you have to read the documentation creatively.) From perlrun:
-n causes Perl to assume the following loop around your program, which makes it iterate over filename arguments somewhat like sed -n or awk: LINE: while (<>) { ... # your program goes here }
When you put a '}{' in the middle of that it has the effect of ending the while loop and beginning another block (which is then finished by the old end of the while loop's block.)
I think I picked it up from someone's round of golf. I'd give credit if I knew to whom it was due.
-sauoq "My two cents aren't worth a dime.";
|
|---|