pookybear has asked for the wisdom of the Perl Monks concerning the following question:

Probably a silly question, but how do I get the path to the /public folder in Dancer?

I want to store/read csv files under the public folder, but don't know if Dancer offers any convenience methods to get the base path to the public folder.

The error I get when trying to create a file by saying:

open(FILE, ">>", "myapp/public/file.csv") or die "$!";

is:

No such file or directory in /ur/share/perl5/Dancer/Handler.pm l. 98

I'm not sure why it's going to Handler.pm?

Replies are listed 'Best First'.
Re: How to get public folders path in Perl Dancer ( config->{public} )
by Anonymous Monk on Aug 17, 2014 at 18:54 UTC
      Thank you so much! I saw the Dancer::Config module but didn't know how to use it. Does that mean that whenever I want to use config helpers in my own modules, I'm going to have to do use Dancer; in that module? Would that be the right way of going about it?