[vienna.pm] ANNOUNCE: CGI::URI2param 1.0

Thomas Klausner domm at zsi.at
Wed Jan 9 13:18:57 CST 2002


* * * vienna-pm-list * * *


Hi!

The URL

    http://domm.zsi.at/source_code/modules/CGI-URI2param-1.00.tar.gz

has entered CPAN as

  file: $CPAN/authors/id/D/DO/DOMM/CGI-URI2param-1.00.tar.gz
  size: 4133 bytes
   md5: 2b216c471242e72dbcfc73059431756e

The main thing that changed is that I included Apache::URI2param, a
PerlInitHandler. 

>From the README:

CGI::URI2param - convert parts of an URL to param values

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');
		     
If you are using mod_perl, please take a look at Apache::URI2param.
It provides an Apache PerlInitHandler to make running CGI::URI2param
easier for you. Apache::URI2param is distributed along with
CGI::URI2param.

-- 
 D_OMM      +---->  http://domm.zsi.at <-----+
 O_xyderkes |       neu:  Arbeitsplatz       |   
 M_echanen  | http://domm.zsi.at/d/d162.html |
 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