"Dr.Ruud" <rvtol+use...@isolution.nl> writes:

> On 24/06/2013 07:36, lee wrote:
>
>> It would be like:
>>
>> if ( $color eq "blue" ) {
>>    print "test\n";
>>    last;
>> }
>
> Alternative:
>
>   print( "test\n" ), last
>     if $color eq "blue";
>
>
> I also see:
>
>   print( "test\n" ) and last
>     if $color eq "blue";
>
> but always question that, because: what if print() fails?
> (even if it can't fail, it is hard to read such ambiguous code, every
> time again)

Yes --- my conclusion is that it's better to avoid appending conditions
to statements ...


-- 
"Object-oriented programming languages aren't completely convinced that
you should be allowed to do anything with functions."
http://www.joelonsoftware.com/items/2006/08/01.html

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to