CGI::Application::Plugin::Redirect man page on Pidora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Pidora logo
[printable version]

CGI::Application::PlugUserRContributed PeCGI::Application::Plugin::Redirect(3)

NAME
       CGI::Application::Plugin::Redirect - Easy external redirects in
       CGI::Application

SYNOPSIS
	package My::App;

	use CGI::Application::Plugin::Redirect;

	sub cgiapp_prerun {
	    my $self = shift;

	    if ( << not logged in >> ) {
		return $self->redirect('login.html');
	    }
	}

	sub byebye {
	    my $self = shift;

	    return $self->redirect('http://www.example.com/', '301 Moved Permanently');
	}

DESCRIPTION
       This plugin provides an easy way to do external redirects in
       CGI::Application.  You don't have to worry about setting headers or
       worrying about return types, as that is all handled for you.

       "redirect" does an external redirect, which means that the browser will
       receive a command to load a new page, and a fresh request will come in.
       If you just want to display the results of another runmode within the
       same module, then it is often sufficient to use the "forward" method in
       CGI::Application::Plugin::Forward instead.

METHODS
   redirect($url, $status)
       Interupt the current request, and redirect to an external URL.  If you
       happen to be inside a prerun method when you call this, the current
       runmode will automatically be short circuited so that it will not
       execute.	 As soon as all prerun method have finished, the redirect will
       happen without the runmode being executed.

       The $status paramater is optional as the CGI module will default to
       something suitable.

	 return $self->redirect('http://www.example.com/');

	 - or -

	 return $self->redirect('http://www.example.com/', '301 Moved Permanently');

SEE ALSO
       CGI::Application, CGI::Application::Plugin::Forward, perl(1)

AUTHOR
       Cees Hek <ceeshek@gmail.com>

LICENCE AND COPYRIGHT
       Copyright (c) 2005, Cees Hek.  All rights reserved.

       This module is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

DISCLAIMER OF WARRANTY
       BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
       FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT
       WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
       PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND,
       EITHER EXPRESSED ORIMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
       ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH
       YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL
       NECESSARY SERVICING, REPAIR, OR CORRECTION.

       IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
       WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
       REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE
       TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR
       CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
       SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
       RENDERED INACCURATE OR LOSSESSUSTAINED BY YOU OR THIRD PARTIES OR A
       FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
       SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
       DAMAGES.

perl v5.14.1			  2011-06CGI::Application::Plugin::Redirect(3)
[top]

List of man pages available for Pidora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net