Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: lower case

by btrott (Parson)
on Feb 18, 2000 at 22:57 UTC ( #3699=note: print w/replies, xml ) Need Help??


in reply to lower case

The fact that you said "match" sounds like you're talking about a regular expression... is that the case? If so, you can just say
if ($var =~ /bob/i) { # Bob matches bob }
Or, as the previous poster said, if you're just trying to compare two strings case-insensitively, use
if (lc $var eq "bob") { # Bob matches bob }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://3699]
help
Chatterbox?
[erix]: o/
[erix]: I'm a bit stuck with regex capturing. Anyone wants to ahve a look at my [erix://pad | scratchpad ? (it's the little test program at the top there)]
[erix]: hm [erix://pad]
[erix]: pad::/erix

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (6)
As of 2018-01-19 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (216 votes). Check out past polls.

    Notices?