Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
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 examining the Monastery: (10)
As of 2014-12-18 06:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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





    Results (44 votes), past polls