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;
In reply to Re^2: Splitting output of a system command into an array
by jwkrahn
in thread Splitting output of a system command into an array
by sKiBa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |