my $string = " a b c "; # note leading/trailing whitespaces my @array1 = split /\s+/, $string; # returns '', 'a', 'b', 'c' (4 items) my @array2 = split ' ', $string; # returns 'a', 'b', 'c' (3 items)