[Dancer-users] messed up routes

Mr. Puneet Kishor punk.kish at gmail.com
Thu Oct 20 05:51:46 CEST 2011


as much as I love Dancer, and I really truly do... as I said when I first used Dancer, it is a breath of fresh air in the world of Perl, Dancer has become really, really unreliable for me. The biggest problem that I face with it is the unreliable way I seem to get routes and layouts delivered to the browser. In my last email to this forum, I noted that I would get different layout than was expected. Today I decided to do a little experimentation. My routes are like so

	get '/video/:page_name/:movie' => sub {
		..
		debug "using layout main_video";        
		layout 'main_video';
		template 'video_mov', \%template_opts;
	};
	
	get '/present/:page_name' => sub {
		..
		debug "using layout main_presentation";
		layout 'main_presentation';
		template 'presentation_slides', \%template_opts;
	};
			
	get '/*?' => sub {
		..
		debug "using layout main";
		template 'index', \%template_opts;
	}

In my layouts I have also embedded debug strings like so

	<!-- main.tt -->

	<!-- main_presentation.tt -->

	<!-- main_video.tt -->

Yet, when I go to a page that should be using the layout main, my log file says

	[88056] debug @0.001454> [hit #14]using layout main in ..

yet, I can see using "View source" in the browser 

	<!-- main_presentation.tt -->

This is random, and it makes absolutely no sense. I would love to see this resolved, because, partly, I really, really love using Dancer. And, partly, I am sure there is nothing out there that is as easy and pleasurable to use. I shudder at the thought of going back to CGI::App, but I also can't let this unreliability continue.

Suggestions? I am serving about 10 or 12 different apps using Starman proxied behind Apache2, if that is any help.

--
Puneet Kishor


More information about the Dancer-users mailing list