http://www.perlmonks.org?node_id=1027431


in reply to Print from array element to another array element

The easiest way to do it would be to use substr
use strict; use warnings; my $string = "catfood"; $string = substr($string,3,4); print "$string\n";
You could also work on a copy of the original string by assigning the value to a separate string say :
my $new_string = substr($string,3,4);