in reply to for loops and 'and'
Ooh, that's weird. The problem is clearly with precedence and context.
I have no idea why that doesn't mean print for 1..10;. I can make a case for that meaning print for 10;, but it is crazy that 1..10 evaluates false on the left of low precedence or.$ perl -e'print for (1..10 or a..z);' abcdefghijklmnopqrstuvwxyz$
I'm eagerly anticipating an explanation.
Update: This prints nothing,
This must be hooked up with the odd special case mentioned by davido that $. is hooked up with flipflops when thay have constant arguments. Dwimmerie gone berserk.$ perl -e'print scalar(1..10)' $
After Compline,
Zaxo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: for loops and 'and'
by ysth (Canon) on Nov 30, 2003 at 08:18 UTC | |
|
Re: Re: for loops and 'and'
by Anonymous Monk on Nov 30, 2003 at 07:19 UTC | |
|
Re: Re: for loops and 'and'
by Roger (Parson) on Dec 01, 2003 at 00:11 UTC | |
|
Re: Re: for loops and 'and'
by jweed (Chaplain) on Nov 30, 2003 at 06:51 UTC |