my $last= ( " AB CDE FG HI JKL " =~ /( \w\w )/g )[-1]; print $last, $/; __END__ prints " FG " (not " HI ")