#!usr/bin/perl -w use strict; my $x = 'ASDSSDSDDDAAAAEDCDALSOSSKDQWSDSD'; print substr($x,4-1,8-4+1); #strings start at index 0 and not index 1. #prints SSDSD