my $str = 'abcdefgh';
print substr($str, 2, 3), "\n"; 
print substr($str, 2), "\n"; 
print substr($str, 0, -1), "\n"; 
print substr($str, index($str, 'd'), 3), "\n"; 
print substr($str, index($str, 'de'), 3), "\n";