in reply to Win32::API Memory Exception with GetCommandLine() (which returns a static string)
Which versions of perl/Win32::API are you using?
I cannot reproduce your problem using AS811(5.8.6)/0.41
C:\test>junk a string[18] = 'perl -x -S junk a ' C:\test>junk a b c d e f g h string[32] = 'perl -x -S junk a b c d e f g h ' C:\test>type junk.bat @rem = '--*-Perl-*-- @echo off if "%OS%" == "Windows_NT" goto WinNT perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9 goto endofperl :WinNT perl -x -S %0 %* if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl if %errorlevel% == 9009 echo You do not have Perl in your PATH. if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul goto endofperl @rem '; #!/usr/bin/perl -w #line 15 use Win32::API; Win32::API->Import("kernel32", "LPTSTR GetCommandLine()"); my $string = pack("Z*", GetCommandLine()); print "string[".length($string)."] = '$string'\n"; __END__ :endofperl C:\test>perl -MWin32::API -wle"print $Win32::API::VERSION" 0.41
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Win32::API Memory Exception with GetCommandLine() (which returns a static string)
by Anonymous Monk on Jul 06, 2007 at 03:14 UTC | |
by BrowserUk (Patriarch) on Jul 06, 2007 at 04:18 UTC | |
by Wyrdweaver (Beadle) on Jul 07, 2007 at 17:55 UTC | |
by BrowserUk (Patriarch) on Jul 07, 2007 at 18:38 UTC |