You need to transform the variable using the lc function (or the uc).

Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]

----- Original Message -----
From: "Bob Williams" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 16, 2003 2:13 PM
Subject: Making script case insensitive


How can this script compare two lists and save the matched components while
being insensitive to case? This script compares a subscription list against
the standard list and removes the emails not in the standard list. It works,
but if cases do not match in every detail, it fails. Thanks.

%bingo_subscribers = {}; open(BINGO, $BINGO_SUBSCRIPTION_FILENAME);
while(<BINGO>){
  chomp($_); $bingo_subscribers{$_} = 1; } @valid_bingo_subscribers = ();
open(MASSMAIL1, $MASS_MAIL_FILENAME);
while(<MASSMAIL1>){   chomp($_);
($user_email, $user_name) = split(/:/, $_);
  if ($bingo_subscribers{$_} == 1)  {    push(@valid_bingo_subscribers,
$user_email);  }
} open(BINGO_VALID, ">$VALID_BINGO_SUBSCRIPTION_FILENAME");
foreach $valid_subscriber (@valid_bingo_subscribers)
{  print BINGO_VALID $valid_subscriber ."\n"; }


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to