$pattern = qq|(?i)$pattern| if $ignore_case;
して・・・
print "$tript#$key2n" if m!$pattern!o;
かなかな。。。