A. Pagaltzis
2005-08-03 03:06:44 UTC
Hi all,
and hi Randall in particular. I have a working version of this,
largely derived from ::Hidden for consistency in slot names. (It
also let me copy 95% of the POD verbatim. Writing documentation
is easy when it’s already done for you. *g*)
It has a somewhat distinct personality in that it wants an
explicit list of page names to validate (I’d rather prefer if
::Hidden worked the same way – I like my code hardwired for “no
surprises ever possible”) and works slightly differently in a few
minor aspects. But by and large a well-written ::Hidden app would
translate to a ::PathInfo one with almost no changes.
I’ve also added a little twist so that “foo.cgi/bar/42” will
dispatch to “My::App::bar” and set the “page_id” slot to 42 in
the process. (The slot defaults to undef.) This is very handy for
cruft-free, clean URLs.
I’ve pondered doing more extensive URL parsing than what I
currently have, based on the fact that the list of valid page
names is known; but I couldn’t think of good, simple conventions
for the meaning of the addition path segments, so I left it out
for the time being. I think the best course of action would be to
pass those to a slot so the user can define any behaviour they
desire, and leave the default implementation of that slot empty.
Now my question is: should I put this on CPAN, or should I leave
the space to an “official” version? Or should I just post it
here, maybe? If I put this on CPAN myself, what should I put in
the AUTHOR and COPYRIGHT & LICENSE sections of the POD? There is
so little code in there that the notion of authorship is a bit
ridiculous either way, but I also copied several pages of POD
that I can hardly claim authorship of.
Regards,
and hi Randall in particular. I have a working version of this,
largely derived from ::Hidden for consistency in slot names. (It
also let me copy 95% of the POD verbatim. Writing documentation
is easy when it’s already done for you. *g*)
It has a somewhat distinct personality in that it wants an
explicit list of page names to validate (I’d rather prefer if
::Hidden worked the same way – I like my code hardwired for “no
surprises ever possible”) and works slightly differently in a few
minor aspects. But by and large a well-written ::Hidden app would
translate to a ::PathInfo one with almost no changes.
I’ve also added a little twist so that “foo.cgi/bar/42” will
dispatch to “My::App::bar” and set the “page_id” slot to 42 in
the process. (The slot defaults to undef.) This is very handy for
cruft-free, clean URLs.
I’ve pondered doing more extensive URL parsing than what I
currently have, based on the fact that the list of valid page
names is known; but I couldn’t think of good, simple conventions
for the meaning of the addition path segments, so I left it out
for the time being. I think the best course of action would be to
pass those to a slot so the user can define any behaviour they
desire, and leave the default implementation of that slot empty.
Now my question is: should I put this on CPAN, or should I leave
the space to an “official” version? Or should I just post it
here, maybe? If I put this on CPAN myself, what should I put in
the AUTHOR and COPYRIGHT & LICENSE sections of the POD? There is
so little code in there that the notion of authorship is a bit
ridiculous either way, but I also copied several pages of POD
that I can hardly claim authorship of.
Regards,
--
#Aristotle
*AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};
&Just->another->Perl->hacker;
#Aristotle
*AUTOLOAD=*_=sub{s/(.*)::(.*)/print$2,(",$\/"," ")[defined wantarray]/e;$1};
&Just->another->Perl->hacker;