my $available_space = `df $dir`; if ($? != 0) { warn "df failed: command was `df $dir`"; }