Discussion:
[Mason-devel] Pure perl trick that Apache::Table might be doing in C (fwd)
Dave Rolsky
2009-07-12 04:36:03 UTC
Permalink
---------- 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
David E. Wheeler
2009-07-12 16:32:48 UTC
Permalink
Post by Dave Rolsky
"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.
Hrm. Looking at my Apache::FakeTable module, I believe that issue was
addressed:

0.02 Thu Sep 4 05:32:22 2003
- Fixed behavior of each to match that of Apache::Table. It
will now
return multiple key/value pairs for a single key that has
multiple
values.

Feel free to pull that into Mason if you like.

Best,

David

Loading...