in reply to Re: replace all but first
in thread replace all but first
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:... @myarray = split /></,$line; if ( $prev ne $myarray[0] ) { $prev = $myarray[0]; } else { $myarray[0] = "<TAB"; } $line = join '><', @myarray; print OUTFILE, $line; ...
$line =~ s/<TAB>/\t/;
|
|---|