sub nthword { my ($texttomatch, $fieldnum) = @_; (split /\s+|^/, $texttomatch)[$fieldnum]; }