http://www.perlmonks.org?node_id=611761


in reply to Problem with qx/system and long urls

My educated guess:

Windows CMD.EXE has a limit on the total # of bytes for environment variables and the names of the variables: 32,767. Your URL has 16K bytes, and it's put in the environment more than once (request_uri, path, query_string). So the process can't be created with that big an environment.

Solution: use HTTP POST method instead of GET.

Although the IETF standards don't specify a maximum length for URLs, RFC2616 does say "Note: Servers ought to be cautious about depending on URI lengths above 255 bytes, because some older client or proxy implementations might not properly support these lengths."

FYI: Microsoft IE and IIS limit URLs to about 2K.

  • Comment on Re: Problem with qx/system and long urls

Replies are listed 'Best First'.
Re^2: Problem with qx/system and long urls
by bluelu (Initiate) on Apr 24, 2007 at 15:41 UTC
    Thanks for your answer! I used GET because I wanted to have bookmarkable urls, so I could rerun the simulation again and again, or even send the link to another person who could then run the simulation on his computer, by simply clicking the link. So I guess I have to find a workaround for this. By using HTTP POST, I'm not able to bookmark the urls anymore. Does the linux shell (bash) has the same limit, or can environment variables be undefinitely big? I could start the server in cygwin or even vmware with linux then.
      Could you collect the data that is in the post into a database row and give people that row id as a token in a single query string param?

      Phil

      The Gantry Web Framework Book is now available.
        That would be a possibility. I intented however to start the server localy on each server.
        But I will probably move to a centralised approach after all.
      { local %ENV = map { $_ => "$ENV{$_}" } qw{ ALLUSERSPROFILE APPDATA COMMONPROGRAMFILES COMPUTERNAME COMSPEC FB_FILE HOMEDRIVE HOMEPATH LOGONSERVER OS PATH PATHEXT PROGRAMFILES PROMPT SESSIONNAME SYSTEMDRIVE SYSTEMROOT TEMP USERDOMAIN USERNAME USERPROFILE WINDIR }; print qx{ dir }; }
        ++. That's exactly what I needed :-)