Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^5: How to match String with Case Sensitive??

by vitoco (Friar)
on Oct 30, 2009 at 13:12 UTC ( #804151=note: print w/replies, xml ) Need Help??


in reply to Re^4: How to match String with Case Sensitive??
in thread How to match String with Case Sensitive??

Hey! You are trying to match a constant against a pattern got from an input string. Is that what you want? Then try what moritz suggested.

If not, change to:

if($test1 =~ m#$test#){

But without i modifier, "abc" will never be the same as "AbC".

Of course, to be "the same" instead of just "contains", use:

if($test1 =~ m#^$test$#){

or:

if($test1 eq $test){

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://804151]
help
Chatterbox?
[erix]: how does one find out how to install a program like cvsgrep
[erix]: I mean, I suppose it's just the one file so I can download that
[erix]: Makefile.PL should tell me, probably

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2017-06-22 16:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (524 votes). Check out past polls.