in reply to substr problem

Just a matter of subtraction then to go back a specified number of characters from the end of a string.
#!perl -w use strict; my $str = "me like cookies"; my $slen = length($str); my $howfarback = 7; #Pick from $howfarback position back for substring my $newstr=substr($str, $slen - $howfarback, $howfarback); print "$newstr \n";

nandeya