On Feb 7, Leon said:
>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.
Not all strings have a numeric value of zero.
- Original Message -
From: "wim" <[EMAIL PROTECTED]>
> When I do:
>
> if ( $menuitem == "modify_router") {
> print "Modify router";
> } else {
> print "Add router";
> }
>
> it doesn't work. But when I change it to:
> How comes?
Apart from the fact that == is used for nu
On Wed, 6 Feb 2002, wim wrote:
> I have a small question: what's the difference between == and eq?
== is for numeric comparisons, eq is for textual comparisons.
See perldoc perlop
-- Brett
http://www.chapelperi
eq is used for comparing strings while == is used for numeric comparisons.
HTH
-Original Message-
From: wim
To: [EMAIL PROTECTED]
Sent: 2/6/2002 8:39 AM
Subject: Difference between == and eq
Hello,
I have a small question: what's the difference between == and eq?
When I do
- Original Message -
From: "wim" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 06, 2002 8:39 AM
Subject: Difference between == and eq
> Hello,
>
> I have a small question: what's the difference between == and eq?
== i
eq: to use for the strings
= : to use in numeric contest.(if you = in string contest in every true).
If you don't know if are string or numerical use eq
Walter
> Hello,
>
> I have a small question: what's the difference between == and eq?
>
> When
Hello,
I have a small question: what's the difference between == and eq?
When I do:
if ( $menuitem == "modify_router") {
print "Modify router";
} else {
print "Add router";
}
it doesn't work. But when I change it to:
if ( $menuitem e