NAME
Limper::Differences - differences between Limper and Dancer
VERSION
version 0.015
DESCRIPTION
This document describes the differences between Limper and Dancer, as well as planned features, what will never happen, etc.
This just covers the basic differences of what is described on the main documentation page for Dancer, and not deeper differences. More about use, less about design.
Differences
Routes
Limper also has trace.
Limper's any really matches any. The following syntax is not supported:
any ['get', 'post'] => '/myaction' => sub { ... };
Instead, you can chain routes together:
get post => '/myaction' => sub { ... };
This is both cleaner code and cleaner syntax.
Limper does not support prefix, and likely never will.
Hooks
Limper has three hooks: after, request_handler, and response_handler.
Limper's after is similar to Dancer's after.
Other hooks may be added as needed.
Logging
Limper has info and warning. They send to STDOUT and STDERR, respectively.
Dancer also has debug and error, which Limper might get.
There is currently no way to configure these.
Config
Limper does not currently use a config file.
Dancer's setting (and it's alias set) allow you to get/set config setting, though it also accesses some sort of current settings under some condition.
Response Headers
Limper and Dancer both have headers. Limper's will also return the current headers as a list or arrayref.
However, Limper will currently replace all headers with whatever is passed to it.
Dancer's header is just an alias for headers.
Something like push_header is currently not supported, but could be supported by a plugin.
Status
Limper's status can also set a custom phrase to return with the code (will likely only work with the built-in server).
Dancer's status can take a code's standard name in lower case instead of the code.
Request
Limper's request is just a simple hashref.
Differences that are outside the scope of Limper proper
Data Structure Conversion
Limper will never have any of these, but plugins can easily be created for them:
from_dumper to_dumper
from_json to_json
from_yaml to_yaml
from_xml to_xml
Boolean
Limper does not define true or false. Dancer's true and false is just 1 and 0, which is annoying because then you can't use boolean;
.
Sending Files and MIME Types
See "send_file" in Limper::SendFile and "mime_types" in Limper::SendFile.
Sugary Things
These are all implemented in Limper::Sugar:
limper_version load captures dirname halt send_error uri_for redirect content_type path
Currently Unsupported
The following are currently unsupported, and may or may not be supported later, either in Limper itself or via a plugin.
var, vars
This should be trivial enough to implement in Limper.
params, param, param_array
There should be a plugin for this.
splat
Something like this would be nice. Currently the following will work, though:
get qr{^/file/([^/]+)\.([^/]+)$} => sub {
my ($file, $extension) = ($1, $2);
...
};
Yes, it's hideous. "megasplat" is much more complex.
forward
Unknown complexity.
pass
Unknown complexity.
cookie, cookies
Unknown complexity.
session
Unknown complexity.
upload
Unknown complexity. Perhaps a plugin.
template
Unknown complexity. Will be a plugin.
engine
Unknown complexity. Perhaps a plugin. Related to template.
load_app
Unknown complexity. Without prefix, I'm not sure how useful this really is. Limper does not have the degree of containment that Dancer has.
Features Limper has that Dancer does not
response
This returns a hashref of what the current response will be when the route ends. It can be inspected and modified as needed. I don't know how to get at any of these values easily under Dancer, outside of a hook.
COPYRIGHT AND LICENSE
Copyright (C) 2014 by Ashley Willis <ashley+perl@gitable.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.4 or, at your option, any later version of Perl 5 you may have available.