@numberlist=('First','Second','Third','Fourth','Fifth'); #and so on as high as the maximal number of matches you expect @results= map(/^(lean : sigma)/,@arr); $i=0; foreach (@results) { print $numberlist[$i++]," content=> $_\n"; }