echo \"tests\"|perl -pe \"s/s[t$]//g\" Unmatched [ in regex; marked by <-- HERE in m/s[ <-- HERE 5.020000/ at -e line 1, <> line 1.
Can\'t
You have to escape the $ sign, because it is a special character:
$
echo "tests"|perl -pe "s/s[t\\$]//g"