Diff::LibXDiff(3)
π Diff::LibXDiff π
okay so bestie, welcome to the Diff::LibXDiff page β it's from the User Contributed Perl Documentation section, and it lives in section 3 of the manual, so it's a library/module page. grab a boba, we're doing diffs π
β¨ NAME β¨
Diff::LibXDiff β calculate a diff with LibXDiff (via XS), no cap π
π VERSION π
Version 0.05 β yes, that's the whole version, slay.
πΈ SYNOPSIS πΈ
okay so here's the whole vibe in code form, literally copy-paste it:
use Diff::LibXDiff;
my $string1 = <<_END_
apple
banana
cherry
_END_
my $string2 = <<_END_
apple
grape
cherry
lime
_END_
my $diff = Diff::LibXDiff->diff( $string1, $string2 )
my $bin_diff = Diff::LibXDiff->bdiff( $bin_string1, $bin_string2 )
# $diff is ...
@@ -1,3 +1,4 @@
apple
-banana
+grape
cherry
+lime
see how banana got yeeted and grape and lime showed up? that's the whole personality of a diff. iconic π
π¦ DESCRIPTION π¦
Diff::LibXDiff is a binding of LibXDiff (over at <http://www.xmailserver.org/xdiff-lib.html>) to Perl via XS π«Ά
and ngl, the flex here is real: LibXDiff is the basis of the diff engine for git π so you're literally using the same energy that powers everyone's favorite version control tool.
π METHODS π
$diff = Diff::LibXDiff->diff( $string1, $string2 )
takes $string1 and $string2, figures out the textual diff, and hands you the result back as a string β¨
$patched = Diff::LibXDiff->patch( $original, $patch ) / ( $patched, $rejected ) = Diff::LibXDiff->patch( $original, $patch )
give it an $original string and a $patch string, and it computes the patched string for you π
okay important tea: if the patching algorithm can't place a hunk, it returns a second "rejected" result instead β but only if you called it in list context. so if you want the rejects, ask for them properly π
$bdiff = Diff::LibXDiff->bdiff( $bin1, $bin2 )
binary diff time π§ takes $bin1 and $bin2 and returns the result as a string. it's giving diff but for binaries, lowkey powerful.
$bpatched = Diff::LibXDiff->bpatch( $original, $patch )
and this one calculates the patched binary given an $original string and a $patch string π©·
π AUTHOR π
Robert Krimen, <rkrimen at cpan.org> π
π₯ SEE ALSO π₯
- <http://www.xmailserver.org/xdiff-lib.html>
- Algorithm::Diff
π BUGS π
found a bug? a feature request? bestie please report it π«Ά send it to bug-diff-libxdiff at rt.cpan.org, or use the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Diff-LibXDiff>.
and here's the deal: the author gets notified, and then you'll automatically be notified of progress on your bug as changes get made. it's a whole mutual-notification situationship, fr fr β¨
π SUPPORT π
you can find documentation for this module with the perldoc command, like so:
perldoc Diff::LibXDiff
and there's more info floating around at these spots:
- RT: CPAN's request tracker β <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Diff-LibXDiff>
- AnnoCPAN: Annotated CPAN documentation β <http://annocpan.org/dist/Diff-LibXDiff>
- CPAN Ratings β <http://cpanratings.perl.org/d/Diff-LibXDiff>
- Search CPAN β <http://search.cpan.org/dist/Diff-LibXDiff/>
π ACKNOWLEDGEMENTS π
so this section exists in the original and it is literally empty β nothing underneath it, not a single word π keeping it here anyway because we keep every detail, periodt.
π COPYRIGHT & LICENSE π
Copyright 2009 Robert Krimen, all rights reserved.
This program 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 was Diff::LibXDiff(3), rendered by perl v5.42.0 and dated 2025-07-25 β thanks for reading, mwah π π¦β¨
π¦ where this page comes from
- fedora 43: perl-Diff-LibXDiff 0.05-26.fc43 Β· LicenseRef-Callaway-LGPLv2+ AND (GPL-1.0-or-later OR Artistic-1.0-Perl)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms