http://qs321.pair.com?node_id=671789


in reply to Question on File position, pulling words

Consider your variables are separated by space, then you can try like,

use strict; while(<DATA>){ chomp; print "IN:$&\n" if($_ =~/\s[^\s]+\s[^\s]+$/); }

Punitha