If you want to preserve whitespace inside double quotes, you can use
Text::CSV instead of
split:
use warnings;
use strict;
use Text::CSV;
use Data::Dumper;
my $str = q(xxxxx "alpha 2" xxx xxxxx "name " xxx xxx xxxx xxx);
my $csv = Text::CSV->new( { binary => 1, sep_char => ' '} ) # should
+set binary attribute.
or die "Cannot use CSV: ".Text::CSV->error_diag ();
my $status = $csv->parse($str); # parse a CSV string into fiel
+ds
my @columns = $csv->fields(); # get the parsed fields
print Dumper(\@columns);
__END__
$VAR1 = [
'xxxxx',
'alpha 2',
'xxx',
'xxxxx',
'name ',
'xxx',
'xxx',
'xxxx',
'xxx'
];