in reply to Re: Re: Re: Re: Formatted Text
in thread Formatted Text
(The | means to execute the given command and make it's output available via the filehandle. See perlipc.)open DISKSPACEIN, "df -k|" or die "couldn't start df -k: $!";
Then change your while (<DISKSPACE>) to while (<DISKSPACEIN>).
It's also an especially good idea when using pipes (the "df -k|" argument to open makes what's called a pipe) to explicitly close the filehandle and check the result, so after the while loop, put:
See perlipc for more about this.close DISKSPACEIN or die "got df error: $! $?";
|
|---|