PNG  IHDR* pHYs+ IDATx]n#; cdLb Ǚ[at¤_:uP}>!Usă cag޿ ֵNu`ݼTâabO7uL&y^wFٝA"l[|ŲHLN밪4*sG3|Dv}?+y߉{OuOAt4Jj.u]Gz*҉sP'VQKbA1u\`& Af;HWj hsO;ogTu uj7S3/QzUr&wS`M$X_L7r2;aE+ώ%vikDA:dR+%KzƉo>eOth$z%: :{WwaQ:wz%4foɹE[9<]#ERINƻv溂E%P1i01 |Jvҗ&{b?9g=^wζXn/lK::90KwrюO\!ջ3uzuGv^;騢wq<Iatv09:tt~hEG`v;3@MNZD.1]L:{ծI3`L(÷ba")Y.iljCɄae#I"1 `3*Bdz>j<fU40⨬%O$3cGt]j%Fߠ_twJ;ABU8vP3uEԑwQ V:h%))LfraqX-ۿX]v-\9I gl8tzX ]ecm)-cgʒ#Uw=Wlێn(0hPP/ӨtQ“&J35 $=]r1{tLuǮ*i0_;NƝ8;-vݏr8+U-kruȕYr0RnC]*ެ(M:]gE;{]tg(#ZJ9y>utRDRMdr9㪩̞zֹb<ģ&wzJM"iI( .ꮅX)Qw:9,i좜\Ԛi7&N0:asϓc];=ΗOӣ APqz93 y $)A*kVHZwBƺnWNaby>XMN*45~ղM6Nvm;A=jֲ.~1}(9`KJ/V F9[=`~[;sRuk]rєT!)iQO)Y$V ی ۤmzWz5IM Zb )ˆC`6 rRa}qNmUfDsWuˤV{ Pݝ'=Kֳbg,UҘVz2ﴻnjNgBb{? ߮tcsͻQuxVCIY۠:(V뺕 ٥2;t`@Fo{Z9`;]wMzU~%UA蛚dI vGq\r82iu +St`cR.6U/M9IENDB` REDROOM
PHP 5.6.40
Preview: htmldiff.pl Size: 1.81 KB
//proc/thread-self/root/usr/share/doc/perl-Algorithm-Diff/htmldiff.pl

#!/usr/bin/perl -w
# diffs two files and writes an HTML output file.
use strict;
use CGI qw(:standard :html3);
use Algorithm::Diff 'traverse_sequences';
use Text::Tabs;

my ( @a, @b );

# Take care of whitespace.
sub preprocess
{
	my $arrayRef = shift;
	chomp(@$arrayRef);
	@$arrayRef = expand(@$arrayRef);
}

# This will be called with both lines are the same
sub match
{
	my ( $ia, $ib ) = @_;
	print pre( $a[$ia] ), "\n";
}

# This will be called when there is a line in A that isn't in B
sub only_a
{
	my ( $ia, $ib ) = @_;
	print pre( { -class => 'onlyA' }, $a[$ia] ), "\n";
}

# This will be called when there is a line in B that isn't in A
sub only_b
{
	my ( $ia, $ib ) = @_;
	print pre( { -class => 'onlyB' }, $b[$ib] ), "\n";
}

# MAIN PROGRAM

# Check for two arguments.
print "usage: $0 file1 file2 > diff.html\n" if @ARGV != 2;

$tabstop = 4;    # For Text::Tabs

# Read each file into an array.
open FH, $ARGV[0];
@a = <FH>;
close FH;

open FH, $ARGV[1];
@b = <FH>;
close FH;

# Expand whitespace
preprocess( \@a );
preprocess( \@b );

# inline style
my $style = <<EOS;
	PRE {
		margin-left: 24pt; 
		font-size: 12pt;
	    font-family: Courier, monospaced;
		white-space: pre
    }
	PRE.onlyA { color: red }
	PRE.onlyB { color: blue }
EOS

# Print out the starting HTML
print

  # header(),
  start_html(
	{
		-title => "$ARGV[0] vs. $ARGV[1]",
		-style => { -code => $style }
	}
  ),
  h1(
	{ -style => 'margin-left: 24pt' },
	span( { -style => 'color: red' }, $ARGV[0] ),
	span(" <i>vs.</i> "),
	span( { -style => 'color: blue' }, $ARGV[1] )
  ),
  "\n";

# And compare the arrays
traverse_sequences(
	\@a,    # first sequence
	\@b,    # second sequence
	{
		MATCH     => \&match,     # callback on identical lines
		DISCARD_A => \&only_a,    # callback on A-only
		DISCARD_B => \&only_b,    # callback on B-only
	}
);

print end_html();

Directory Contents

Dirs: 0 × Files: 6

Name Size Perms Modified Actions
12.04 KB lrw-r--r-- 2014-11-26 05:35:09
Edit Download
1.71 KB lrw-r--r-- 2014-11-26 05:38:10
Edit Download
977 B lrw-r--r-- 2014-11-26 05:35:09
Edit Download
17.14 KB lrw-r--r-- 2014-11-26 05:35:09
Edit Download
1.81 KB lrw-r--r-- 2014-11-26 05:35:09
Edit Download
3.26 KB lrw-r--r-- 2014-11-26 05:35:09
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).
© 2026 REDROOM — Secure File Manager. All rights reserved. Built with ❤️ & Red Dark UI