Perl Dancer and Mason2

204 Views Asked by At

I am using Mason2 template for Dancer. When I try to invoke "Dancer qw(session)" in template I got error shown bellow. I just write "hello world" application with root route showing index.mc template. I have installed latest perl 5.26 and Dancer version 1.3513.

template:

<%class>
use Dancer qw(session);
</%class>

<%augment wrap>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Portal</title>
    <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
    <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">


  <body>

    <div class="container">
        <div class="page-header">
          TESTING
          <br>
          <% inner() %>

  </body>
</html>
</%augment>

error:

Couldn't find declarator 'method' at C:/Strawberry/perl/vendor/lib/Devel/Declare/Context/Simple.pm line 47.
    Devel::Declare::Context::Simple::skip_declarator(Method::Signatures::Simple=HASH(0x5df6ac8)) called at C:/Strawberry/perl/vendor/lib/Devel/Declare/MethodInstaller/Simple.pm line 62
    Devel::Declare::MethodInstaller::Simple::parser(Method::Signatures::Simple=HASH(0x5df6ac8), "method", 0, 1) called at C:/Strawberry/perl/vendor/lib/Devel/Declare/MethodInstaller/Simple.pm line 25

    

What I am missing ?

1

There are 1 best solutions below

1
Nick Tonkin On

Method::Signatures is broken with the latest version of Devel::Declare. Install Devel::Declare version 0.006019 or lower if you want to use Method::Signatures.

We updated recently to Function::Parameters because of this.