http://qs1969.pair.com?node_id=574421


in reply to A question regarding cookies

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^2: A question regarding cookies
by bart (Canon) on Sep 22, 2006 at 18:43 UTC
    This can't work:
    my $html_template = $self->param('html_template'); ... $html_template->process('home', ... );
    So, where is the object supposed to come from? $html_template is, if set by the form, a string, so you're actually doing a class method call, most likely of a nonexistent package, and even if it exists, it most probably doesn't have a process method.

    So there is where it goes wrong.

    I think you still have to create a new html_template object from the parameter.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^2: A question regarding cookies
by gellyfish (Monsignor) on Sep 22, 2006 at 18:45 UTC

    You appear to be expecting the param('html_template'); to return an object but it is returning the literal string 'html_template' which is why you are getting the error that you are. The other problem with your code is that you are printing a header with the cookie straightaway whereas you actually need to be adding the the cookies to the headers you output before your main output. I really don't want to see the rest of your code, but you will need to add the cookie to a header elsewhere in your code,

    /J\