Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (14)
As of 2014-12-18 20:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (61 votes), past polls