16 Dec
2012
16 Dec
'12
1:01 a.m.
On Sat, 15 Dec 2012, gvim wrote:
Just realised I may be missing the obvious - if Dancer was object oriented you wouldn't have:
get '/routename' => sub { };
... but rather something like:
my $d = Dancer->new;
This is an object constructor but in Perl you don't have to call it 'new'.
$d->get('/routname', $subref);
The $d object needs some values for the 'get' attribute. In one line: my $d = Dancer->new->get('/routname', $subref); Mmm, I do not need $d and let's write 'Dancer->new->get' as get: get '/routename' => sub { }; Very object oriented IMHO. -- Henk