Jason Vas Dias
2010-05-26 15:05:14 UTC
Hi -
Being very pleased to find HTML::Mason purporting to provide everything I'd
expect from a Web-Programing framework (and alot more!) I was disappointed
to find that many of the "$src/samples/*" or documentation code example
snippets can be made to work only with major modication - for example
the "samples/dump-request" sample code produces the error:
System error
error: Can't locate object method "header_in" via package
"Apache2::RequestRec" at /home/jason/public_html/cgi-bin/dump-request.mcgi
line 18.
context:
...
14: $r-><a href="#uri">uri</a>( [$uri] ) = <% $r->uri()
%><BR>
15: $r-><a href="#filename">filename</a>(
[$filename] ) = <% $r->filename() %><BR>
16: $r-><a href="#path_info">path_info</a>(
[$path_info] ) = <% $r->path_info() %><BR>
17: $r-><a href="#args">args</a> = <% $r->args %><BR>
18: $r-><a href="#header_in">header_in</a>( $header_name,
[$value] ) = <% $r->header_in("Content-type") %><BR>
19: $r-><a href="#get_remote_host">get_remote_host</a> = <% $r-
21: $r-><a href="#auth_type">auth_type</a> = <% $r->auth_type
%><BR>
22: $r-><a href="#auth_name">auth_name</a> = <% $r->auth_name
%><BR>
...
code stack: /home/jason/public_html/cgi-bin/dump-request.mcgi:18
raw error
This happens under both Fedora Core 12:
httpd-2.2.14-1.fc12.x86_64
apr-devel-1.3.9-3.fc12.x86_64
and RHEL-5:
httpd-2.2.3-43.el5
apr-devel-1.2.7-11.el5_3.1
.
I'm trying to set a cookie value in a cgi script :
my $Cookie = CGI::Cookie->new(-name=>'text2car_client', value=>$cookie);
$r->header_out('Set-Cookie' => $Cookie );
How is one meant to do this in Mason without use of the header_out() routine -
attempts to print a header even with '(CGI->new())->header(...)' end up
including the header in the document data.
Also, there is no $m->log object, as documented at
http://www.masonhq.com/docs/manual/Devel.html#logging
Is HTML::Mason being maintained ?
Is there any up-to-date documentation for it that contains working examples ?
I'm beginning to conclude that the answer to both questions is "NO" and that I
should use the raw mod_perl / CGI.pm interfaces instead.
I hope someone can disabuse me of this conclusion - as documented, Mason looks
great, but it is currently not behaving as documented .
Thanks in advance,
Jason.
Being very pleased to find HTML::Mason purporting to provide everything I'd
expect from a Web-Programing framework (and alot more!) I was disappointed
to find that many of the "$src/samples/*" or documentation code example
snippets can be made to work only with major modication - for example
the "samples/dump-request" sample code produces the error:
System error
error: Can't locate object method "header_in" via package
"Apache2::RequestRec" at /home/jason/public_html/cgi-bin/dump-request.mcgi
line 18.
context:
...
14: $r-><a href="#uri">uri</a>( [$uri] ) = <% $r->uri()
%><BR>
15: $r-><a href="#filename">filename</a>(
[$filename] ) = <% $r->filename() %><BR>
16: $r-><a href="#path_info">path_info</a>(
[$path_info] ) = <% $r->path_info() %><BR>
17: $r-><a href="#args">args</a> = <% $r->args %><BR>
18: $r-><a href="#header_in">header_in</a>( $header_name,
[$value] ) = <% $r->header_in("Content-type") %><BR>
19: $r-><a href="#get_remote_host">get_remote_host</a> = <% $r-
get_remote_host %><BR>
20: $r-><a href="#requires">requires</a> = <% $r->requires %><BR>21: $r-><a href="#auth_type">auth_type</a> = <% $r->auth_type
%><BR>
22: $r-><a href="#auth_name">auth_name</a> = <% $r->auth_name
%><BR>
...
code stack: /home/jason/public_html/cgi-bin/dump-request.mcgi:18
raw error
This happens under both Fedora Core 12:
httpd-2.2.14-1.fc12.x86_64
apr-devel-1.3.9-3.fc12.x86_64
and RHEL-5:
httpd-2.2.3-43.el5
apr-devel-1.2.7-11.el5_3.1
.
I'm trying to set a cookie value in a cgi script :
my $Cookie = CGI::Cookie->new(-name=>'text2car_client', value=>$cookie);
$r->header_out('Set-Cookie' => $Cookie );
How is one meant to do this in Mason without use of the header_out() routine -
attempts to print a header even with '(CGI->new())->header(...)' end up
including the header in the document data.
Also, there is no $m->log object, as documented at
http://www.masonhq.com/docs/manual/Devel.html#logging
Is HTML::Mason being maintained ?
Is there any up-to-date documentation for it that contains working examples ?
I'm beginning to conclude that the answer to both questions is "NO" and that I
should use the raw mod_perl / CGI.pm interfaces instead.
I hope someone can disabuse me of this conclusion - as documented, Mason looks
great, but it is currently not behaving as documented .
Thanks in advance,
Jason.