if (my @match = split /\s+/) { if ($match[-2] =~ /^\d{1,3}$/ and $match[-1] !~ /\D/) { $match[-2] = $count++; } $_ = "@match\n"; } #### /([^ ]+)\s+([^ ]+)\s+([^ ]+)...\s+(\d{1,3})\s+(\d+)$/ #### /(\S+)\s+(\S+)\s+(\S+)\s+...\s+(\d{1,3})\s+(\d+)$/ #### my $pat = join ( '\\s+', ( ('(\\S+)' x 15), '(\\d{1,3})', '(\\d+)', )); $pat = qr/\A$pat\z/;