Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Dancer not displaying Templateby nathaniels (Acolyte) |
on Sep 21, 2013 at 05:45 UTC ( [id://1055106]=perlquestion: print w/replies, xml ) | Need Help?? |
nathaniels has asked for the wisdom of the Perl Monks concerning the following question: I've recently been toying with moving some Perl code into a web setting using Dancer. Below is some code to generate a list of files in a specific folder and then take in the user's selection. However, when run through the browser it simply generates a blank page. What's confusing for me is that the unrelated code following the template determines whether or not it will generate the page. This works:
This doesn't:
Thanks for your help! UPDATE:Thank you to everyone for their help. As always, one of the best results of posting on here is learning about all the other small mistakes or inefficiencies in your code unrelated to the code-breaking problem. Special thanks to CountZero, it would probably have taken me months to realize template must go at the end of the sub. Turns out my biggest mistake (which I omitted in my post as it seemed irrelevant) was trying to pass a list (rather than a reference to a list) to the template. Thank you all!
Back to
Seekers of Perl Wisdom
|
|