Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
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 wandering the Monastery: (19)
As of 2015-07-01 15:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (6 votes), past polls