in reply to SOLVED Printing last two characters

If you want a regexp, this will work
/(.{2})$/
The '$' means the end of the string.
perl -le 'my $str="qwerty"; $str=~m/(.{2})$/; print $1;' #output ty