#my ($chr, $pos) = (split ' ', $locations[$indexes[$rand_index]])[0, 1]; my ($chr, $pos) = (split '', $locations[$indexes[$rand_index]])[0, 1]; $chr = 'chromosome' . ($_ % 4 + 1); $pos = $_ + 10;