use Text::ParseWords; my @x = shellwords("-x '1 2 3' -y 4 5"); print join("\n", @x); -x 1 2 3 -y 4 5