[dancer-users] Dancer DSL vs. Perl Critic

Stefan Hornburg (Racke) racke at linuxia.de
Mon Dec 21 21:31:50 EST 2020


On 12/21/20 10:26 PM, Mike Diehl wrote:
> OMG!
> 
> All I had to do was use Dancer2 in my route module?
> 
> /me feels pretty silly.
> 
> Thanks,
> 
> Mike.
> 

Hello Mike,

if you use separate modules for your routes (good idea!), don't forget to tie these to your main module:

package Demo::Routes::TFA;

use Dancer2 appname => 'Demo';

Otherwise Dancer2 uses multiple apps for your modules, which you most likely don't want for route modules.

Regards
          Racke


> On Mon, Dec 21, 2020 at 4:19 PM Ruth Holloway <ruth at hiruthie.me> wrote:
>>
>> That doesn't *look* to me like a perlcritic message.  That looks more like a perl -c output when "use Dancer2" isn't present.
>>
>> I could be wrong here, but that's the behavior I see on my box (perl 5.28, Dancer2 0.300004). Perl::Critic doesn't seem to mind that statement, with or without Dancer2 being used.
>>
>> D Ruth Holloway
>>
>>
>>
>> On Mon, Dec 21, 2020, at 14:05, Mike Diehl wrote:
>>
>> Hi all,
>>
>> So I've got a line of code like:
>>
>> prefix "/apps/Credit_Card/";
>>
>> I'm using VS Code, which uses Perl::Critic, to edit the program.
>>
>> When Perl::Critic encounters the line above, it see it as a "problem":
>>
>> String found where operator expected at - line 3, near "prefix
>> "/apps/Credit_Card/""
>> (Do you need to predeclare template?)syntax error at - line 3, near
>> "prefix "/apps/Credit_Card/""
>>
>> I know that I can put a ### No critic at the end of the line, but that
>> kind of defeats the purpose of using the tool.
>>
>> How SHOULD I make this "problem" go away?
>>
>> Hope that was clear.
>>
>> Mike.
>> _______________________________________________
>> dancer-users mailing list
>> dancer-users at lists.preshweb.co.uk
>> https://lists.preshweb.co.uk/mailman/listinfo/dancer-users
>>
>>
>> _______________________________________________
>> dancer-users mailing list
>> dancer-users at lists.preshweb.co.uk
>> https://lists.preshweb.co.uk/mailman/listinfo/dancer-users
> _______________________________________________
> dancer-users mailing list
> dancer-users at lists.preshweb.co.uk
> https://lists.preshweb.co.uk/mailman/listinfo/dancer-users
> 


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration. Provisioning with Ansible.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20201221/3a22d32b/attachment.sig>


More information about the dancer-users mailing list