use Win32::ShellQuote qw( quote_cmd ); say quote_cmd("some_cmd", @ARGV);