I am ashamed of myself that I cannot figure this out on my own.

I am trying to write a small Perl script that will display the amount of data in the trash can (KDE). I plan on using this as part of my Conky script.

Code:
#! /usr/bin/perl

use warnings;
use strict;

my @du=`du -m ~/.local/share/Trash/files/`;

print "total(@du)\n";

sub total {
        my @du2=shift;
        my $size=0;
        foreach (@du2) {
                if ($du2[$_] =~ /^(\d+)/) {
                        $size += $1;
                }
        }
$size;
}
The output I get is the same as if I had run the 'du -k' command at the shell except this also places a closing parenthesis at the end.

That and I just realized that that "." entry tells me that it is 739MB when I know there is 202MB in the trash can.

What am I doing wrong?

P.S. I'm sure there's an easier way to do this but now I'm just so determined to get this to work first before I try an easier way. I've already tried opening a directory handle to the trash directory and then using the stat() function to get the size but that didn't work.