> Or even if you don't want them to be identical but just similar in that they
> contain the same string somewhere within the variable, i.e.
> 
> $a2 = 'Lambott';
> $a3 = 'fooLambottblah';
> 
> if ($a3 =~ /$a2/) {
> # do something
> }
> else {
> # do something else
> }
> 
> or what if you want to match it regardless of case?
> 
> $a2 = 'Lambott';
> $a3 = 'laMboTt';
> lc($a2);
> lc($a3);
> 
> # Now $a2 eq $a3 because both of
> # their values are lower-cased to 'lambott'.

I'd just modify your first case.

instead of

if ($a3 =~ /$a2/) {

I'd say

if ($a3 =~ /$a2/i) {


They both work.  Just tossing out new ideas for folks to play with :)

Dennis

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

Reply via email to