Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 }


Comment on Re: lower case
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (15)
As of 2014-07-31 19:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (252 votes), past polls