use warnings; use strict; use IPC::System::Simple qw/capturex/; print capturex( $^X, 'showcmdline.pl', 'foo\\" bar\\\\', 'open(my $x,">&STDOUT");' ); __END__ "C:\Strawberry\perl\bin\perl.exe" "showcmdline.pl" "foo\\\" bar\\\\" "open(my $x,\">&STDOUT\");" ( "showcmdline.pl", "foo\\\" bar\\\\", "open(my \$x,\">&STDOUT\");", )