Do DSL words need a Plugin?
20 Sep
2015
20 Sep
'15
2:48 p.m.
A ::Plugin needs 2 name spaces Dancer:: and Dancer2:: But what about this construct: --------------------- package MyApp::DSL; # ABSTRACT: Just some syntax sugar for MyApp use strict; use warnings; use Exporter qw(import); our $VERSION = '0.01'; # VERSION our @EXPORT_OK = qw( request_accept_language ); our $twist = 2; # or 1; BEGIN { $twist = (defined $INC{'Dancer2.pm'}) ? 2 : 1; } use if $twist == 2 , 'Dancer2'; use if $twist == 1 , 'Dancer' => ':syntax'; sub request_accept_language { return request->accept_language; } 1; --------------------- This one does not need any config and maybe all common words can be in some common ::Sugar NB: Next related post is about Plugins with some config. -- Henk
3701
Age (days ago)
3701
Last active (days ago)
0 comments
1 participants
participants (1)
-
Henk van Oers