use warnings; no warnings ('uninitialized', 'substr'); my $str="name"; my $index=12; my $s=substr($str,$index,1); print $s;