NAME
Term::HiliteDiff - Hilites differences in text with ANSI escape codes
VERSION
Version 0.01
DESCRIPTION
SYNOPSIS
This module hilites differences between lines/records of text. It was directly inspired by the --difference mode provided by the watch(1) program on Linux.
use Term::HiliteDiff 'watch';
for my $num ( 0 .. 1_000_000 ) {
print watch( $num ), "\n";
}
EXPORT
This module optionally exports watch
and hilite_diff
under most circumstances. When perl is invoked as a one-liner with -e
, both watch
and hilite_diff
are exported to the main
package.
FUNCTIONS
hilite_diff
$str = hilite_diff( LIST );
$str = hilite_diff();
hilite_diff( LIST );
hilite_diff();
watch
$str = watch( LIST );
$str = watch();
watch( LIST );
watch();
Object oriented
Term::HiliteDiff-
new()>
This class method returns a new Term::HiliteDiff
object.
$obj->hilite_diff
$obj->watch
AUTHOR
Joshua ben Jore, <twists@gmail.com>
TODO
- Objects
-
This uses a single process global state for tracking differences. It should use objects so multiple things can be watched.
- Pluggable drivers
-
Pluggable drivers. hilite_diff() is essentially exactly the same as watch() but it edits the marked up text differently. I'd be good to offer a unified diff and HTML rendering as well.
It'd also be nice to have an API that would allow decaying changes to be visible. So a change in one line is somehow visible N lines into the future.
- Tests
-
I totally skipped those. I know how I'm going to generate them, I just haven't yet.
BUGS
Please report any bugs or feature requests to bug-term-hilitediff@rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Term-HiliteDiff. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
ACKNOWLEDGEMENTS
COPYRIGHT & LICENSE
Copyright 2006 Joshua ben Jore, All Rights Reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.