mail; touch jejejejeje as the input A safer, but more convoluted, way to do this is using open with "-|": open (DA, "-|") || exec "du", "$dir"; @output = ;