hotshot has asked for the wisdom of the Perl Monks concerning the following question:

Helll fellow monks !

Can anyone sugguest where I can find out about reading objects sent to my CGI (I mean html objects), is there a useful module I can use? or something else.
Thanks.

Hotshot

Replies are listed 'Best First'.
Re: objects in cgi
by princepawn (Parson) on Dec 23, 2001 at 16:01 UTC
    oh I see... well then do this instead of CGI::Dump():
    my $cgi = CGI->new; use Data::Dumper; printf "<xmp> %s </xmp>", Dumper($cgi);
      sorry about the ignorance, but what does that code you gave do, and can you explain or tell me where can I find some explaination about what is this thing (object).

      Hotshot
        it just prints out everything that CGI.pm has figured out from the POST/GET request to your CGI program... this way we can see the "guts" of CGI.pm instead of making use of its pretty Dump function.

        If you don't know about Data::Dumper, you are missing a module that is possibly one of the most useful ever written for Perl.

Re: objects in cgi
by IlyaM (Parson) on Dec 23, 2001 at 21:52 UTC
    I'm not sure but it looks like an error in JavaScript code which submits form. CGI::Dump should print query parameters as it is. [object] is just a string which your CGI got from user agent. I have not played with JavaScript for long time but AFAIK if some variable contains an object and it is used in string (like in code "somevar: " + somevar) then it is converted to string [object].

    --
    Ilya Martynov (http://martynov.org/)

Re: objects in cgi
by princepawn (Parson) on Dec 23, 2001 at 14:31 UTC
    I don't know what you mean by objects sent to your CGI.... do you mean "form elements"? Can you give an example?

    have you looked at the CGI documents? You might also want to look at the CGI.pm author's website for more info

Re: objects in cgi
by hotshot (Prior) on Dec 23, 2001 at 14:54 UTC
    something to clarify, I had avariable, $state for the example, that returned the state of the current page the user is in. when I used print CGI::Dump() to dump the list of vars I get from web I could see:
    * state - createUser # for example
    Now, the web designer here changed the page to return objects and when I try CGI::Dump() again I now get:
    * state - [object]
    and that's new to me, so I ask for a little help here, is there something wrong with the javascript code (that the web designer wrote) that the CGI can't handle, or is there something I'm missing here?

    Hotshot