Dave Rolsky
2009-07-12 04:36:03 UTC
---------- Forwarded message ----------
Date: Sat, 11 Jul 2009 15:03:03 +0930
From: Andrew Kirkpatrick <***@ubermonkey.net>
To: ***@urth.org
Subject: Pure perl trick that Apache::Table might be doing in C
Hi David,
Perhaps this belongs on the Mason mailing lists, but I'm not sure which one,
anyway if so let me know and I'll post there.
Around here:
http://search.cpan.org/~drolsky/HTML-Mason-1.42/lib/HTML/Mason/CGIHandler.pm#HTML::Mason::FakeTable_Methods
There is the statement:
"HTML::Mason::FakeTable is designed to behave exactly like Apache::Table, and
differs in only one respect. When a given key has multiple values in an
Apache::Table object, one can fetch each of the values for that key using
Perl's each operator"
I took that as an interesting exercise, and not having written a tie since the
late 90s thought to give it a go. The result is a class that achieves the
interface of Apache::Table, at least in that respect (see attached). I made it
a modulino so you can give it a spin easily.
Hopefully it proves useful to someone. I've been striving to modernize the perl
environment at the University of Adelaide, and while I think Catalyst is a
clear winner for some apps I'm considering doing some CMS work in Mason.
Cheers,
Andrew Kirkpatrick
Date: Sat, 11 Jul 2009 15:03:03 +0930
From: Andrew Kirkpatrick <***@ubermonkey.net>
To: ***@urth.org
Subject: Pure perl trick that Apache::Table might be doing in C
Hi David,
Perhaps this belongs on the Mason mailing lists, but I'm not sure which one,
anyway if so let me know and I'll post there.
Around here:
http://search.cpan.org/~drolsky/HTML-Mason-1.42/lib/HTML/Mason/CGIHandler.pm#HTML::Mason::FakeTable_Methods
There is the statement:
"HTML::Mason::FakeTable is designed to behave exactly like Apache::Table, and
differs in only one respect. When a given key has multiple values in an
Apache::Table object, one can fetch each of the values for that key using
Perl's each operator"
I took that as an interesting exercise, and not having written a tie since the
late 90s thought to give it a go. The result is a class that achieves the
interface of Apache::Table, at least in that respect (see attached). I made it
a modulino so you can give it a spin easily.
Hopefully it proves useful to someone. I've been striving to modernize the perl
environment at the University of Adelaide, and while I think Catalyst is a
clear winner for some apps I'm considering doing some CMS work in Mason.
Cheers,
Andrew Kirkpatrick