develooper Front page | perl.beginners | Postings from February 2002

RE: Difference between == and eq

Thread Previous | Thread Next
From:
Murphy, Land
Date:
February 6, 2002 06:47
Subject:
RE: Difference between == and eq
Message ID:
3C1E7DE94919AA46B8B13100DA3F5A6804D06969@lrd1exc2.abcbs.net
 eq is used for comparing strings while == is used for numeric comparisons.

HTH

-----Original Message-----
From: wim
To: beginners@perl.org
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:

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

it doesn't work. But when I change it to:

if ( $menuitem eq "modify_router") {
.....

It works!
How comes?

-- 
Kind regards,

Wim De Hul
Belgacom Belbone
--------------------------------
  Mail   : wdh@belbone.be
  Mobile : +32 479 952004
  Ripe   : WDH25-RIPE
  Registered Linux User: #260015
--------------------------------


-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About