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

Already on GitHub? Sign in to your account

__DATA__ section strange behavior #345

Closed
rbucker opened this Issue Jun 26, 2012 · 3 comments

Comments

Projects
None yet
2 participants

rbucker commented Jun 26, 2012

I'm not certain that this is a bug but I'll lay it out anyway. I'm getting a 404 error demo the "Duct tape for the HTML5 web" sample.

I opened a VIM session and copy/pasted the source. One thing I noticed was that there was a pair of leading spaces in front of every line of code except the header. morbo was able to run the code but when I launched my browser I received a 404 error. When I removed all of the leading spaces the code worked as expected.

initially I thought it might be the /DATA/ token itself. So I restored the code with the leading spaces and removed the spaces from the /DATA/ line and tested again. I received the same error.

I then removed the spaces from the contents of the clock template and tested again. Same 404.

I removed the spaces from the @@ line and put the spaces back in the template And suddenly I get a 200 with the time.

I put the spaces back in the /DATA/ and tested again. The server returned a 200 (but clearly VIM's syntax highlighting failed).

Anyway, I do not know what the syntax requirements are for the @/@ line in the /DATA/ section is/are. But since the other elements can have leading spaces I suppose it's reasonable here too and consistency is king.

PS: Perl version 5.16.0 and mojo 3.0

rbucker commented Jun 26, 2012

sometimes you gotta hate mark.

rbucker commented Jun 26, 2012

PS: perl makes no such promise that the DATA token is going to be the first token in the line or that there is not whitespace between the beginning of the line and the DATA token. (although the VIM syntax highlighter does.)

@kraih kraih closed this Jun 26, 2012

rbucker commented Jun 27, 2012

thank you for your kind consideration on this matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment