in reply to Re^2: CGI: Saving javascript variables
in thread CGI: Saving javascript variables

There are only four ways I know for JavaScript to inform Perl about anything: 1) as a querystring on a GET request, 2) as a field in a form sent as a POST request, 3) as either GET or POST on an AJAX request, 4) by having JavaScript write to a cookie and then having Perl retrieve the cookie.

You'd have to explain your overall goal for me to know which of those is best for you. I'm just answering the part of the question about sending something JavaScript knows to a Perl script.

In a hidden field you could do something like these:
<input type="hidden" name="folder_opts" id="folder_opts"> <script type="text/javascript"> document.getElementById('folder_opts').value = '{"f1":' + fi_value + ',"f2":' + f2_value + '}'; </script>
Then on the Perl side, you'd read the folder_opts param, turn it into a Perl hash with one of the JSON modules.