Re: for ... else

2007-03-03 Thread Larry Wall
On Sat, Mar 03, 2007 at 01:39:35AM +0100, Thomas Wittek wrote: : Luke Palmer schrieb: : That is not what it means in Python. : : You trapped me. :) Actually I don't know any python but I've once read a : for/else construct in python. But obviously it doesn't dwIm. : : From the Python Reference

Re: for ... else

2007-03-03 Thread Thomas Wittek
Larry Wall: : if ($item = 'foobar') { == of course ;) If you actually wrote that, then you'll always find that the first item has the value 'foobar'. :) Well, leaving out the extraneous stuff, here's both kinds of else in one: $result = first 42, (@items || say No items.)

Re: for ... else

2007-03-03 Thread Darren Duncan
At 11:17 PM +0100 3/3/07, Thomas Wittek wrote: Larry Wall: : if ($item = 'foobar') { == of course ;) If you actually wrote that, then you'll always find that the first item has the value 'foobar'. :) Care to try a third time? I don't think the numeric-casting == will do what

Re: for ... else

2007-03-03 Thread Juerd Waalboer
Thomas Wittek skribis 2007-03-03 23:17 (+0100): Larry Wall: : if ($item = 'foobar') { == of course ;) Or how about eq? :) -- korajn salutojn, juerd waalboer: perl hacker [EMAIL PROTECTED] http://juerd.nl/sig convolution: ict solutions and consultancy [EMAIL PROTECTED] Ik