for(my $i = 0; $i <= $#filedata; ++$i){ if($filedata[$i] =~ m/\d\.\.\d/){ my $branch = $filedata[$i];}} print("$branch \n");