perl-CGI-Easy-URLconf - map url path to handler sub and vice versa

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package name perl-CGI-Easy-URLconf
Package version 2.0.1
Package release alt1
Package architecture noarch
Package type rpm
Installed size 27.38 KB
Download size 27.38 KB
Official Mirror
This module provide support for clean, user-friendly URLs. This can be
archived by configuring web server to run your CGI/FastCGI script for any
url requested by user, and let you manually dispatch different urls to
corresponding handlers (subroutines). Additionally, you can take some
CGI parameters from url's path instead of usual GET parameters.
The idea is to set rules when CGI/FastCGI starts using:
a) setup_path() - to map url's path to handler subroutine
(also called "view")
b) setup_view() - to map handler subroutine to url
and then use:
a) path2view() - to get handler subroutine matching current url's path
b) view2path() - to get url matching some handler subroutine
(for inserting into HTML templates or sending redirects).
'/articles/'        => \&list_articles,
'/articles.php'     => \&list_articles,
'/index.php'        => \&show_home_page,
setup_path( POST =>
'/articles/'        => \&add_new_article,
my $r = CGI::Easy::Request->new();
my $handler = path2view($r);
\&list_articles     => '/articles/',
printf '<a href="%s">Articles</a>', view2path(\&list_articles);
printf '<form method=POST action="%s">', view2path(\&add_new_article);
my $h = CGI::Easy::Headers->new();
These two parts (setup_path() with path2view() and setup_view() with view2path())
can be used independently - for example, you don't have to use
setup_view() and view2path() if you prefer to hardcode urls in HTML templates
instead of generating them dynamically. But using both parts will let you
configure *all* urls used in your application in single place, which make
it easier to control and modify them.
In addition to simple constant path to handler and vice versa mapping you
can also map any path matching regular expression and even copy some data
from path to GET parameters. Example:
'/article.php'          => \&show_article,
qr{^/article/(\d+)/$}   => set_param('id') => \&show_article,
qr{^/old/}              => \&unsupported,
\&show_article          => [
with_params('id')       => '/article/?/',
$url = view2path(\&show_article, id=>123);


Package Version Architecture Repository
perl-CGI-Easy-URLconf - - -


Name Value
/usr/share/perl5 -
perl(Export/ -
perl(URI/ -
perl( -
perl( -
perl-base >= 1:5.10.1
rpmlib(PayloadIsLzma) -


Name Value
perl(CGI/Easy/ = 2.0.001
perl-CGI-Easy-URLconf = 2.0.1-alt1


Type URL
Binary Package perl-CGI-Easy-URLconf-2.0.1-alt1.noarch.rpm
Source Package perl-CGI-Easy-URLconf-2.0.1-alt1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    rpm [Sisyphus] noarch autoimports
    rpm [Sisyphus] noarch autoimports
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-CGI-Easy-URLconf rpm package:
    # sudo apt-get install perl-CGI-Easy-URLconf



See Also

Package Description
perl-CGI-Echo-1.08-alt2_9.noarch.rpm CGI-Echo module for perl
perl-CGI-Embedder-1.21-alt1.noarch.rpm perl module CGI-Embedder
perl-CGI-Emulate-PSGI-Streaming-1.0.0-alt1.noarch.rpm streaming PSGI adapter for CGI
perl-CGI-EncryptForm-1.02-alt1.noarch.rpm Implement trusted stateful CGI Form Data using cryptography
perl-CGI-Enurl-1.07-alt1.noarch.rpm perl module CGI-Enurl
perl-CGI-ExceptionManager-0.06-alt1.noarch.rpm DebugScreen with detach!
perl-CGI-ExtDirect-3.24-alt1.noarch.rpm RPC::ExtDirect gateway for CGI
perl-CGI-FCKeditor-0.02-alt1.noarch.rpm perl module CGI-FCKeditor
perl-CGI-FileManager-0.06-alt1.noarch.rpm Managing a directory structure on an HTTP server
perl-CGI-FileManager-scripts-0.06-alt1.noarch.rpm CGI-FileManager scripts
perl-CGI-FileUpload-0.03-alt1.noarch.rpm A module to upload file through CGI asynchrnously, know where the upload status and get back the fi
perl-CGI-Form-Table-0.161-alt1.noarch.rpm create a table of form inputs
perl-CGI-Form2XML-1.6-alt1.noarch.rpm perl module CGI-Form2XML
perl-CGI-FormBuilder-Config-Simple-0.12-alt1.noarch.rpm deploy web forms w/ .ini file
perl-CGI-FormBuilder-Mail-FormatMultiPart-1.0.6-alt1.noarch.rpm Plugin module for CGI::FormBuilder->mailresults()