Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

eq vs. ==

by c (Hermit)
on Jul 20, 2003 at 10:19 UTC ( #276020=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if ($val eq '2') {
      print 'foo';
    }
    
  2. or download this
    if ($val == '2') {
      print 'foo';
    }
    
  3. or download this
    (Why do we have separate numeric and string comparisons?  Because
    we don't have special variable types, and Perl needs to know
    whether to sort numerically (where 99 is less than 100) or 
    alphabetically (where 100 comes before 99)
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://276020]
Approved by Corion
Front-paged by broquaint
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2016-12-08 20:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (145 votes). Check out past polls.