----- Original Message -----
From: "wim" <[EMAIL PROTECTED]>

> When I do:
>
> if ( $menuitem == "modify_router") {
>          print "Modify router<br>";
> } else {
>          print "Add router<br>";
> }
>
> it doesn't work. But when I change it to:
> How comes?

Apart from the fact that == is used for numeric comparison whilst eq is used
for string comparison, it would be of interest to note that == when used
with strings forces the strings to be read in numeric context which is zero.
Therefore the following returns true.

my $menuitem = 0; #change this to 1 and it will return false.

if ( $menuitem == 'modify_router') {
    print "Modify router<br>";
} else {
   print "Add router<br>";
}






_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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

Reply via email to