use warnings; use strict; use Win32::API; use Data::Dump; my $GetCommandLine = Win32::API->new("kernel32", "GetCommandLine", [], 'P'); ( my $c = pack("a1024", $GetCommandLine->Call()) ) =~ s/\0*$//; print $c, "\n"; dd $0, @ARGV; #### 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\");", )