sub nl () { print "\n"; print "\n" }
####
sub nl () { print "\n\n" }
####
if ($units !~ m{(K|M)B}i ) {
####
if ($units !~ /[KM]B/i ) {
####
my @num = qx[du -B $units -d 1 $in_dir | cut -f 1];
my @dir = qx[du -B $units -d 1 $in_dir | cut -f 2];
####
if ($skip =~ m{,}) {
@sks = split(',', "$skip");
$si = $#sks + 1;
for (my $i = 0; $i < $in; $i++) {
for (my $j = 0; $j < $si; $j++) {
if ($dir[$i] =~ m{$sks[$j]}) {
$num[$i] = 0 }}}}
elsif ($skip !~ m{,}) {
for (my $i = 0; $i < $in; $i++) {
if ($dir[$i] =~ m{$skip}) {
$num[$i] = 0 }}}
else { print "$skip is not a directory. Please ensure $skip is a dir inside $in_dir." }
####
my @sks = split /,/, $skip;
for my $i ( 0 .. $#num ) {
for my $j ( 0 .. $#sks ) {
if ( $dir[ $i ] =~ /$sks[$j]/ ) {
$num[ $i ] = 0;
}
}
}
####
for (my $i = 0; $i < $in; $i++ ) {
my $temp = $num[$i];
if ($units =~ m{KB}) {
$units =~ s{KB}{kB}g }
$temp =~ s{$units}{}g;
$temp =~ s{ $}{}g;
chomp $temp;
push @dig, $temp }
####
$units =~ s/KB/kB/g;
for my $i ( @num ) {
my $temp = $i;
$temp =~ s/$units//g;
$temp =~ s/ $//g;
chomp $temp;
push @dig, $temp;
}
####
$sum = $sum + $dig[$i];
####
$sum += $dig[ $i ];
####
if ($skip !~ "" && $skip !~ m{,}) {
####
The empty pattern //
If the PATTERN evaluates to the empty string, the
last successfully matched regular expression is
used instead. In this case, only the "g" and "c"
flags on the empty pattern is honoured - the other
flags are taken from the original pattern. If no
match has previously succeeded, this will
(silently) act instead as a genuine empty pattern
(which will always match).
####
if ( length $skip && $skip !~ /,/ ) {
####
elsif ($si > 0) {
####
elsif ( @sks ) {