Monday, January 19, 2015

Print Last 5 String in Perl

my $str = 'I love India';
my $pstr = substr($str, -5);
print $pstr.'
'; ---------------------------- O/P :- India