clean
This commit is contained in:
parent
7a68277bca
commit
6533d835fa
1 changed files with 3 additions and 7 deletions
|
|
@ -16,7 +16,6 @@ use strict;
|
||||||
use Digest::MD5;
|
use Digest::MD5;
|
||||||
use Getopt::Std;
|
use Getopt::Std;
|
||||||
|
|
||||||
my ( $opt_e, $opt_h, $opt_s );
|
|
||||||
my %opts = ();
|
my %opts = ();
|
||||||
getopts('ehms', \%opts);
|
getopts('ehms', \%opts);
|
||||||
|
|
||||||
|
|
@ -30,7 +29,6 @@ if ( $opts{m} ) {
|
||||||
&quick_comp(%sizes);
|
&quick_comp(%sizes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#################################
|
#################################
|
||||||
# functions
|
# functions
|
||||||
|
|
||||||
|
|
@ -74,8 +72,8 @@ sub quick_comp(%) {
|
||||||
|
|
||||||
# same md5 calculation i use in mv_wrap
|
# same md5 calculation i use in mv_wrap
|
||||||
sub calc_md5($) {
|
sub calc_md5($) {
|
||||||
my ($file, $digest, $md5, $FILE);
|
my $file = shift;
|
||||||
$file = shift;
|
my ( $digest, $md5, $FILE );
|
||||||
$md5 = Digest::MD5->new;
|
$md5 = Digest::MD5->new;
|
||||||
open $FILE, "<$file" or die "couldn't open file: $!\n";
|
open $FILE, "<$file" or die "couldn't open file: $!\n";
|
||||||
seek($FILE, 0, 0);
|
seek($FILE, 0, 0);
|
||||||
|
|
@ -173,10 +171,8 @@ sub output($) {
|
||||||
my $string = shift;
|
my $string = shift;
|
||||||
if ($opts{e}) {
|
if ($opts{e}) {
|
||||||
$string =~ s/([ \&\;\`\'\\\"\|\*\?\~\<\>\^\(\)\[\]\{\}\$\010\013\020\011])/\\${1}/g;
|
$string =~ s/([ \&\;\`\'\\\"\|\*\?\~\<\>\^\(\)\[\]\{\}\$\010\013\020\011])/\\${1}/g;
|
||||||
print "$string";
|
|
||||||
} else {
|
|
||||||
print "$string";
|
|
||||||
}
|
}
|
||||||
|
print "$string";
|
||||||
}
|
}
|
||||||
|
|
||||||
sub help {
|
sub help {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue