Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Equality operators

by perladdict (Chaplain)
on Apr 25, 2006 at 13:24 UTC ( [id://545558]=note: print w/replies, xml ) Need Help??


in reply to Equality operators

hi, monks

#!/usr/bin/perl -w if (1 == 1) { print "triue\n"; } if(1 == 2) { print"false\n"; } if ('a' eq 'b') { print "trie\n"; } if('1'eq '1foo') { print "true\n"; } if('1' eq 'foo1') { print "false\n"; }

Here is the proper code which prints and checks the conditions properly If it checks for the numberic and strings.
As per perl comparison, you have to use the above syntax of checking if it in number or strings.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://545558]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-24 17:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found