[Dancer-users] New plugin Dancer-Plugin-FakeCGI

igor.bujna at post.cz igor.bujna at post.cz
Thu Sep 27 12:47:24 CEST 2012


Hi everybody,
let mi introduce my new plugin http://search.cpan.org/~koceasy/Dancer-Plugin
-FakeCGI-0.21/.
This plugin can easily run CGI methods or Perl CGI files under Dancer such 
as this simple example:

# Run specified method in given package

any '/test_1' => sub {
    fake_cgi_method("test_CGI", "test");
    fake_cgi_as_string;
};
<br># Run specified Perl file
any '/test_3' => sub {
    fake_cgi_file("test_CGI_file.pl");
    fake_cgi_as_string;
};<br><br>
This example is append in this plugin in directory examples.
I wrote this plugin to easily move CGI script to use in Dancer. The idea is 
similar as running CGI under mod_perl. Than every package is after first run
cached in memory or can be cached with method fake_cgi_compile.
In next version i want to add emulation CGI function header() and cookie(). 
If someone know how can be easily implemented, than send me email.
In future i would like to extend IO::Capture(such as not save some captured 
text.... )

Bye Igor
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.backup-manager.org/pipermail/dancer-users/attachments/20120927/f5e415fe/attachment.htm>


More information about the Dancer-users mailing list