Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CGI and Searching

Status
Not open for further replies.

samesale

Programmer
Sep 15, 2003
133
0
0
US
I have written the following statements to search for an item that matches spicification. The program works, but if the name of item consists of large letters it will not match. Is there a way to search the name regardless of the letter. In other words, make the search case insensitive.
Thanks for your help.


open(INF, "<item2.out") or dienice("Couldn't open auto.out for reading: $! \n");
@data = <INF>;
close (INF);


use CGI qw(param);
use CGI::Carp qw(fatalsToBrowser);

my $item1 = param("item");
my $price1 = param("price");
my $city1 = param("city");

foreach $i (@data) {
chomp($i);
($count,$name,$email,$address,$city,$state,$zipcode,$phone,$time,$pm,$item,$price,$body,$thismon,$mday,$year)=split(/\|/,$i);

if ($city1 eq $city) {
if ($item1 eq $item) {
if ($price <= $price1) {
 
Sure instead of

Code:
$city1 eq $city

convert it to lowecase and compare

Code:
lc($city1) eq lc($city)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top