Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Turning off case sensitivity when using conditions

by tune (Curate)
on Apr 24, 2001 at 06:37 UTC ( [id://74939]=note: print w/replies, xml ) Need Help??


in reply to Turning off case sensitivity when using conditions

For the sake of TMTOWTDI:
if ($var =~ /^cheese$/i) { # got it }
That is regexp power man, but it is not the best solution. And I did not claim it is the fastest. (now comes the benchmark people:)

-- tune

Replies are listed 'Best First'.
Re (tilly) 2: Turning off case sensitivity when using conditions
by tilly (Archbishop) on Apr 24, 2001 at 16:08 UTC
    Try that with $var set at "cheese\n".

    I think you want \z rather than $ there...

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2024-04-23 08:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found