in reply to du with backticks
You're interpolating $' into your string in quite a few places. I doubt that's what you wanted. Try escaping those $ s in the grep commands.
You might find it easier to dispense with the pipline all together. readpipe (i.e. the backticks) returns a list of the lines read when in list context so you could write:
print grep $_ !~ /^.*Maildir.*cur$/, grep ..., readpipe "du -ch $homedir";
|
|---|