in reply to How to cut strings from the end

You want substr.

my $string = 'perl345'; my $tag = substr $string, -3;
Or if you want to remove the last three characters, too,
my $string = 'monks 1223'; my $tag = substr $string, -3, 3, '';

After Compline,
Zaxo