in reply to Re: Splitting output of a system command into an array
in thread Splitting output of a system command into an array
shift removes an empty string from @words caused by $free starting with spaces.my @words = split /\s+/, $free;
Or you could just use split correctly and you wouldn't have an empty string.
my @words = split ' ', $free;
|
|---|