in reply to Re^2: Matching @ in string
in thread Matching @ in string

... don't want to modify the string by escaping the @ and I want to run program as a one-liner, how do I do it if I can't escape the single quotes

Try: ...

perl -e "print 'h@t'=~ /\@/g"
or even
echo 'h@t' | perl -ne 'print /\@/g'

... depending on the type of problem you are about to solve.

Regards

mwa