Solved

Case Insensitive

Posted on 1998-11-15
3
205 Views
Last Modified: 2010-03-04
How do I make something case insensitive?
Say, if

$variable1 = "Hello";
$variable2 = "HELLO";

How can I tell if variable1 and variable 2 are the same, even though one is totally capitalized, and the other isn't?

Thanks,
Mark
0
Comment
Question by:eversoslightly
  • 2
3 Comments
 
LVL 4

Expert Comment

by:martinag
ID: 1206222
if (lc($variable1) eq lc($variable2)) {
  # I don't know is the "correct" way of doing it, but it works...
}

Martin
0
 
LVL 1

Author Comment

by:eversoslightly
ID: 1206223
Thanks!  Works great - just answer the question, and I'll give ya the points.
0
 
LVL 4

Accepted Solution

by:
martinag earned 10 total points
ID: 1206224
if (lc($variable1) eq lc($variable2)) {
  # I don't know is the "correct" way of doing it, but it works...
}

Martin
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Perl 101 11 81
Perl script not writing to .csv file 6 111
batch script for automated email 12 120
Perl File::Find alternative 1 78
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question