Skip to content

Instantly share code, notes, and snippets.

@e-mon
Created November 3, 2014 12:10
Show Gist options
  • Save e-mon/506029b12b5e221d4a6f to your computer and use it in GitHub Desktop.
Save e-mon/506029b12b5e221d4a6f to your computer and use it in GitHub Desktop.
hoge.pl
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Digest::MD5 qw(md5_hex);
use File::Slurp;
use utf8;
my @fileList = <STDIN>;
shift @fileList;
chomp @fileList;
foreach(@fileList){
for(my $i = 0;$i<$#fileList;$i++){
#print $fileList[$i] . ":" . $_ . "\n";
next if($_ eq $fileList[$i]);
my $a = '/usr/lib/bundle1.o';
if($_ eq $a){
print "same";
}else{
print $a . ":" . length($a) . "\n" . $_ . ":" . length($_) . "\n";
}
print read_file($_,binmode => "utf8")."\n";
#print $_ . " : " .md5_hex(<$_>) . "\n";
#print $fileList[$i] . " : " .md5_hex(<$fileList[$i]>). "\n";
#print "same file!! :" . $_ . " :: " . $fileList[$i] ."\n" if md5_hex($_) eq md5_hex($fileList[$i]);
}
exit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment