in reply to Change files mechanism
Untested, but I think I got the gist of your post.my %result; # preusume @ARGV is loaded with the changeNN files in the right order while (<>) { if (/^L\|(\S+)\s+(.*)/) { $result{$1} = $2; } elsif (/^E\|(\S+)/) { $result{$1} = undef; } else { warn "I don't understand: $_"; } } for (sort keys %result) { my $value = $result{$_}; if (defined $value) { # last thing was a change: print "L|$_ $value\n"; } else { # last thing was a delete: print "E|$_\n"; } }
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|