[vienna.pm] ANNOUNCE: CGI::URI2param 0.03
Thomas Klausner
domm at zsi.at
Thu Jul 5 12:32:06 CDT 2001
* * * vienna-pm-list * * *
Hi!
Mein erstes Module auf CPAN !!
The uploaded file
CGI-URI2param-0_03.tar.gz
has entered CPAN as
file: $CPAN/authors/id/D/DO/DOMM/CGI-URI2param-0_03.tar.gz
size: 2858 bytes
md5: 059f7b717e5b746a1ecde3fc12fb32d5
This is the first public release.
DESCRIPTION:
CGI::URI2param takes a request object (as supplied by CGI.pm or
Apache::Request) and a hashref of keywords mapped to
regular expressions. It applies all of the regexes to the current URI
and adds everything that matched to the 'param' list of the request
object.
Why?
With CGI::URI2param you can instead of:
http://somehost.org/db?id=1234&style=fancy
present a nicerlooking URL like this:
http://somehost.org/db/style_fancy/id1234.html
To achieve this, simply do:
CGI::URI2param::uri2param($r,{
style => 'style_(\w+)',
id => 'id(\d+)\.html'
});
Now you can access the values like this:
my $id=$r->param('id');
my $style=$r->param('style');
--
D_omm
O_xyderkes http://domm.zsi.at
M_echanen
M_asteuei
###
You are subscribed to vienna-pm-list as "Thomas Klausner" <domm at zsi.at>
http://www.fff.at/fff/vienna.pm/
More information about the Vienna-pm
mailing list