[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Goal oriented programming



Peter Scott wrote:
> Actually I often use the post-fix conditional so I can leave out the parens 
> and braces :-)  The idiom I have trouble with is when someone writes 
> something like
> 
> 	/(?flo|je)tsam/ && $rejects++;
> 
> which derails my mental train while I react, "But that's an expression, not 
> a statement!"  My brain is raising a "useless use of expression in void 
> context" exception where no such thing exists.  

This is why God gave us the low-precedence 'and' and 'or':

	open F, "< foo" or die "open foo: $!";
	$x < 0 || $x > $#a and die "out of range"; # throw

John Porter


==== Want to unsubscribe from Fun With Perl?
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org