in reply to Wierd bugs I would have never expected
get '/foo/bar' => sub { # 30 lines of sub here } # more code here
The reason is that a named sub can end with just a curly bracket (and no semicolon), but the line from the callback needs to be finished with a semicolon. When I forget it, I get synatx errors somewhere below in the following code.
The same happens with eval BLOCK.
But the weirdest errors are not perl errors, but something that can happen in every programming language: accidentally running a different copy of the code than what you just modified. Either because it's in a different directory (or, even harder to find) because you're in an ssh session on one xterm, and on the local computer with another xterm. Since I have near-identical copies of my home directories on multiple machines, that can be a real pain to find out.
|
|---|