You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Thomas Klausner <do...@zsi.at> on 2000/11/13 22:22:00 UTC
new module
Hi!
I am currently developing a perl module that is somewhat simmilar
to CGI::PathInfo, and somewhat not. (IMO more not).
The module would be used in a CGI- or mod_perl-environment. It
takes the path-info (or the whole URL) and performs some regular
expressions (defined via some configuration) on it. If the regular
expressions match, the value will be added to $q->param
Example:
URI: /somewhere/on/server/o_date/id1234.html
%config={
order_by=>'o_(\w+)' ,
id=>'id(\d+)' ,
};
# code (simplified !!)
while(my($key,$regex)=each(%config)) {
if ($pathinfo=~/$regex/) {
$q->param($key,$+);
}
}
after this code, $q->param('id') holds "1234" and
$q->param('order_by') holds "date"
Do you think this module would be useful for others?
If so, I will try to put in on CPAN.
I am thinking of naming the module CGI::PathInfoRegex or
Apache::PathInfoRegex. Which name is better suited (or should I
choose a totally difrent name?)
The whole module (definitly alpha code) can be found at :
http://domm.zsi.at/PathInfoRegex-0.01.tar.gz
--
D_OMM http://domm.zsi.at
O_xyderkes
M_echanen NEU (naja): Wohnungs-Historie
M_asteuei http://domm.zsi.at/curvit/wohnen.html