perl get last 6 characters string code example
Example: perl last characters
# For Perl (language) only
# syntax
substr(<your-string>,-<characters-to-extract>)
# example
substr("Glass half empty, glass half full",-15)
# application
my $sRandom = "Glass half empty, glass half full";
my $sLastFewChars = substr($sRandom,-15);
print "[ sRandom : '$sRandom' ] \n[ sLastFewChars : '$sLastFewChars' ]" . "\n";