in reply to Re: replace all but first
in thread replace all but first

Not bad, but to keep it a little more re-usable and flexible (suppose, for instance, more tags/values are added later), you can do away with the $company and $country variables altogether, and do:

... @myarray = split /></,$line; if ( $prev ne $myarray[0] ) { $prev = $myarray[0]; } else { $myarray[0] = "<TAB"; } $line = join '><', @myarray; print OUTFILE, $line; ...
This also takes care of the fact that I think the original author meant <TAB> literally. If I'm wrong, insert this after the join:

$line =~ s/<TAB>/\t/;