[Israel.pm] Useless use of eq

Shlomi Fish shlomif at iglu.org.il
Fri May 30 00:07:44 EEST 2008


On Thursday 29 May 2008, Shmuel Fomberg wrote:
> Hi All.
>
> Can anyone tell me why this line is OK:
> ok( ( $hash->{a} == 7 ) && ( $hash->{b} == 256 ) ,
> "Struct: Build: correct elements");
>
> While this line:
> ok( ( $hash->{a} == 7 ) and ( $hash->{b} == 256 ) ,
> "Struct: Build: correct elements");
> cause a warning:
> Useless use of numeric eq (==) in void context

Maybe it's 

($hash->{a} == 7)
	and
(
	( $hash->{b} == 256)
		,
	"Struct: Build: correct elements"
)

So the comma is part of the right clause?

Regards,

	Shlomi Fish

-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
The Case for File Swapping - http://xrl.us/bjn7i

The bad thing about hardware is that it sometimes work and sometimes doesn't.
The good thing about software is that it's consistent: it always does not
work, and it always does not work in exactly the same way.


More information about the Perl mailing list