in reply to substr problem
#!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";
|
|---|