Example:
my $cities = qr/San Francisco|Los Angeles/;
The scalar $cities
will match San Francisco
and Los An
my $cities = qr/San Fransisco|Los Angeles/i;
Perl regular expression modifiers
It's not that you want to make the scalar $cities
case-insensitive, but the regular expression it is referencing. Use the /i
modifier.
my $cities = qr/San Fransisco|Los Angeles/i;
You may find it useful to read the Perl regular expression tutorial: perldoc perlretut
.