On 25.08.2006 16:37, Marco Lazzeri wrote:
> Marco Lazzeri wrote:
>> Could someone please help me understanding why the next two lines of 
>> code are different?
>>
>>   next unless line =~ /=/
>>
>>   next if !line =~ /=/
> 
> I found out: it's a operators precedence problem.
> 
>   next unless line =~ /=/
>   next if !(line =~ /=/)  # with parenthesis

Note that you can also negate the match operator:

next if line !~ /=/

... or you use "not"

next if not line =~ /=/

My personal favorite here is your first one

next unless line =~ /=/

because it reads nice and clear.

Kind regards

	robert