New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed uninitialized error caused by path #2

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
1 participant
@paraplexed

paraplexed commented Feb 6, 2015

Fixed uninitialized error caused when using path(), also updated documentation to have a working example in the synopsis section.

Found this error 'Use of uninitialized value in subroutine entry at /usr/local/share/perl5/Dancer/FileUtils.pm line 36.' when running the script below. It happens when $self->{settings}{appdir} isn't set. I replicated this with a base install of the lastest Dancer, Dancer::FileUtils, and Dancer::Template::MicroTemplate:

!/usr/bin/env perl

use strict;
use warnings;

use Dancer;
use Dancer::FileUtils 'path';
use Dancer::Template::MicroTemplate;

my $engine = Dancer::Template::MicroTemplate->new;
my $template = path('foo', 'bar.mt');
my $rendered = $engine->render($template, {template_var1 => 1, template_var2 => 2});

get '/' => sub {
"$rendered"
};

dance;

I was assigned this module (Dancer::Template::MicroTemplate) as part of the perl pull challenge (http://blogs.perl.org/users/neilb/2014/12/take-the-2015-cpan-pull-request-challenge.html)

Derek Clifford
Fixed uninitialized error caused by path, also updated documentation …
…to have a working example in the synopsis section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment