$ perl -e ' "abc" =~ /a[$]/ ' Unmatched [ in regex; marked by <-- HERE in m/a[ <-- HERE 5.010000/ at -e line 1.