Text::...SIColor(3pm)
π Name π
Text::WordDiff::ANSIColor β ok so this is the ANSI colored formatting bestie for Text::WordDiff β¨
π Synopsis π
use Text::WordDiff;
my $diff = word_diff 'file1.txt', 'file2.txt';
my $diff = word_diff \$string1, \$string2, { STYLE => 'ANSIColor' };
my $diff = word_diff \*FH1, \*FH2; \%options;
my $diff = word_diff \&reader1, \&reader2;
my $diff = word_diff \@records1, \@records2;
# May also mix input types:
my $diff = word_diff \@records1, 'file_B.txt';
like. look at all those ways to feed it input. she's versatile π
π¦ Description π¦
This class subclasses Text::WordDiff::Base to serve up a formatting class for Text::WordDiff that uses ANSI-standard terminal escape sequences to highlight deleted and inserted text. It's giving β¨glow-upβ¨ but for diff output.
Bestie, real talk: this formatting class is the default class used by Text::WordDiff, so if you wanna know about its interface, go read that documentation, iykyk. And this class should never be used directly β like, not even once. don't do it. periodt π
So Text::WordDiff::ANSIColor formats word diffs for viewing in an ANSI-standard terminal session, and the diff content gets highlighted like this:
π₯ Deletes
Deleted words will display in bold-faced red. The ANSI standard for strikethrough is also used, but since it is not supported by most terminals, likely will not show up π (the vibe is there even if your terminal isn't π).
πΈ Inserts
Inserted words will display in bold-faced, underlined green. slay π
π Everything Else
All other content is simply returned. no notes. untouched. main character energy π
π See Also π
Text::WordDiffText::WordDiff::HTML
π«Ά Support π«Ά
This module is stored in an open repository at the following address:
<https://svn.kineticode.com/Text-WordDiff/trunk/>
Patches against Text::WordDiff are welcome β like, genuinely, we want them π. Please send bug reports to <bug-text-worddiff@rt.cpan.org>.
π Author π
David Wheeler <david@kineticode.com>
Currently maintained by the developers of The Perl Shop <tps@cpan.org>. iconic behavior, no cap β
π Copyright and License π
Copyright (c) 2005-2011 David E. Wheeler. Some Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. π§
π and that's the whole page bestie!! this one shipped with perl v5.36.0 and the date on it is 2022-12-12 β literally in the Text::...SIColor(3pm) section of the User Contributed Perl Documentation, mwah π go forth and diff in color π
π¦ where this page comes from
- debian bookworm: libtext-worddiff-perl 0.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libtext-worddiff-perl 0.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libtext-worddiff-perl 0.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libtext-worddiff-perl 0.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libtext-worddiff-perl 0.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms