Bryan R Harris wrote at Wed, 05 Jun 2002 19:51:49 +0200:

>> $_ % 2 ? print "blue\n" : print "red\n" foreach (@your_list);
> 
> 
> This actually works?!  Very strange notation, how does the compiler see this line?  
>I assume the
> mod operator evaluates to 1-true or 0-false, what does the "?" do?  What does the 
>":" do?  How do
> you have a foreach at the end of a line like that?
> 
> Why do I get the feeling I'm never going to graduate from this list...  =)
> 
> - B
 
Even this snippet is working:

/[02468]$/ ? print "even\n" : print "odd\n" foreach (<DATA>);


Cheerio,
Janek


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to