use String::ShellQuote qw( shell_quote ); my $cmd = shell_quote($^X, "--", $0, @ARGV);