On Wed, Dec 05, 2001 at 02:17:40PM +0200, Vladi Belperchinov-Shabanski wrote:
> > The .. must be understood as the flip-flop operator: eval first part until it
> > gets true, then eval second part until it gets true.
>
> I've read flip-flop operator description in the camel book but...
>
> > When evaluating a test that is a single number, perl compares with line
> > number (ie, $.).
>
> which is strange! accordingly to this, the code (for example):
>
> while(<>){ print if 10; }
> should print 10th line only ($. == 10) which is not correct...
No, no, no! The magic comparaison with $. happens only if you use the
flip-flop operator. 10 is only a constant. But if you did
perl -ne'print if 10..10'
however...
Joy,
`/anick
--
"Common sense and a sense of humor are the same thing, moving at
different speeds. A sense of humor is just common sense, dancing."
- Clive James