Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Comparing Strings

by 7stud (Deacon)
on Jun 24, 2012 at 05:05 UTC ( #978035=note: print w/ replies, xml ) Need Help??


in reply to Comparing Strings

When the user types something in response your prompt:

Enter a word:

(which by the way would be better without the "\n"), they type in a word, and then they hit Return; and when they hit Return an invisible newline character is entered into the input stream:

Enter a word: Mahesh\n

So your $string1 variable will look like this:

$string1 = "Mahesh\n"

...and that will never be eq to the string "Mahesh"


Comment on Re: Comparing Strings
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2015-01-30 10:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (249 votes), past polls