in reply to Re^2: Is it possible to copy arrays from Javascript to Perl variable in the same Perl CGI script?
in thread Is it possible to copy arrays from Javascript to Perl variable in the same Perl CGI script?

However, could I transfer the array generated by js to the same Perl CGI script which generated the js script as well?

Sure. But you'll have to code the script so that it knows what to do...

I still have a nagging feeling that you are missing something fundamental though. You should think through the way data is moving between the browser and your script... remember, there is a new instance of the script running with each request from the browser.

-sauoq
"My two cents aren't worth a dime.";
  • Comment on Re^3: Is it possible to copy arrays from Javascript to Perl variable in the same Perl CGI script?

Replies are listed 'Best First'.
Re^4: Is it possible to copy arrays from Javascript to Perl variable in the same Perl CGI script?
by locked_user sundialsvc4 (Abbot) on May 10, 2012 at 21:08 UTC

    Frankly, what I would suggest that you do is to fire up, say, the Firebug debugger in Firefox and look at the HTTP transactions that take place between the client and the server.   You will see first-hand how the information is encoded and transferred.   If you then examine the documentation for, say, JQuery, alongside the corresponding documentation for CGI, you will then see how each side is equipped to deal with the transfer.

    The key point here is that there are two computer programs in play, written in two entirely different programming languages running on two computers, and they are exchanging data with one another using the agreed-upon protocol that is called "http."

      The key point here is that there are two computer programs in play, written in two entirely different programming languages running on two computers, and they are exchanging data with one another using the agreed-upon protocol that is called "http."

      Never mind the web server and browser themselves...

      And on the server side the CGI script is starting a separate run for each request it handles. (Most likely.)

      -sauoq
      "My two cents aren't worth a dime.";

      Frankly, what I would suggest that you do is ...

      LOL, bones sauoq is not lightoverhead