print grep {substr($_, -length($search)) eq $search} @array; [download]
In reply to Re^2: grep regex exact match last n positions by JavaFan in thread grep regex exact match last n positions by coldy