in reply to Regex question

yes.

if ($vartocheck =~ /\Q$firstchar\E/i) { ... }
that \Q...\E is referred to as quotemeta. it's very useful.

.