@list = $string =~ /"[^"]+"|\S+/g #### @list = grep defined, $string =~ /"([^"]*)"|(\S+)/g;