in reply to making my suroutine and parts of my program case insensitive.

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

  • Comment on Re: making my suroutine and parts of my program case insensitive.