my $count = () = $site =~ /$_/g;
One way would be:
my ( $upper, $lower ) = ( $_, lc $_ );
my $count = () = $site =~ m/$upper|$lower/g;
Edit: Or even simpler:
my $lower = lc $_;
my $count = () = $site =~ m/$_|$lower/g;
Or see The Mad Hatter's suggestion below ;-)
which is the simplest yet.
Cheers, Sören
In reply to Re: making my suroutine and parts of my program case insensitive.
by Happy-the-monk
in thread making my suroutine and parts of my program case insensitive.
by replicant4
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |