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 2002/01/07 20:20:19 UTC

ANNOUNCE: CGI::URI2param 1.00

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  +--------------------------------+



Re: PREANNOUNCE Tied Request and Cookies Module

Posted by Jay Lawrence <Ja...@Lawrence.Net>.
George,

Thanks for your feedback. I got another message of the same nature. *blush*
why didn't I think of this!

I have almost ready to release:

    Apache::Tie::Request
and
    Apache::Tie::Cookie

J

----- Original Message -----
From: "George Sanderson" <ge...@xorgate.com>
To: <mo...@apache.org>
Cc: "Jay Lawrence" <Ja...@Lawrence.Net>
Sent: Saturday, January 12, 2002 10:28 AM
Subject: Re: PREANNOUNCE Tied Request and Cookies Module


> At 10:18 PM 1/7/2002 -0500, Jay Lawrence wrote:
> >
> >I am thinking of names such as:
> >
> >    Apache::Request::Tied
> >    or Apache::Args::Tied
> >and
> >    Apache::Cookies::Tied
> >and
> >    Apache::RequestFiles::Tied
> >
> >or possibly:
> >    Apache::Tied::Request, etc.
> >
> >Any interest, comments, suggestions,
>
> Personally, I like placing the most significant part first and using a
> verb, so how about:
> Apache::Tie::...
> and so forth?
>
>
> +================================+
> | George Sanderson <ge...@xorgate.com>
> | http://www.xorgate.com
> +================================+
>
>


Re: PREANNOUNCE Tied Request and Cookies Module

Posted by George Sanderson <ge...@xorgate.com>.
At 10:18 PM 1/7/2002 -0500, Jay Lawrence wrote:
>
>I am thinking of names such as:
>
>    Apache::Request::Tied
>    or Apache::Args::Tied
>and
>    Apache::Cookies::Tied
>and
>    Apache::RequestFiles::Tied
>
>or possibly:
>    Apache::Tied::Request, etc.
>
>Any interest, comments, suggestions,

Personally, I like placing the most significant part first and using a
verb, so how about:
Apache::Tie::...
and so forth?


+================================+
| George Sanderson <ge...@xorgate.com>
| http://www.xorgate.com
+================================+


PREANNOUNCE Tied Request and Cookies Module

Posted by Jay Lawrence <Ja...@Lawrence.Net>.
Hello All,

I have written a couple modules to provide tied access to GET/POST arguments
of an Apache request. Basically hides the mechanics of libapreq behind a
tied hash. On a similiar vein I have one for cookies. The nice thing about
the cookies one is that it will set headers automatically for you when you
untie it. I will also be writing one for posted and PUT files.

Both are lazy in that they do not do any processing until the first access
of a hash element. I like this strategy since I often use templates. I want
to make all these features available to the templates but not incur
unnecessary processing overhead if the information is not used.

I am thinking of names such as:

    Apache::Request::Tied
    or Apache::Args::Tied
and
    Apache::Cookies::Tied
and
    Apache::RequestFiles::Tied

or possibly:
    Apache::Tied::Request, etc.

Any interest, comments, suggestions,

Yours,
Jay