I have found myself doing quite a bit of mason at work lately, both maintaining old legacy stuff and as the view in a catalyst app.
While doing this I found myself missing the old ‘perl -c’ to quickly sanity check code, however naturally that won’t work on Mason – as mason is essentially HTML with inline perl, not the other way around. As such I wrote a quick script that emulates ‘perl -c’ by loading the file using mason inside eval then printing any errors. The script itself is pretty simple, though it doesn’t have any support for printing useful line numbers – but at least it gives an idea of what/where the problem is. The script also declares $c and $m, as at least for Catalyst – those will be available.
You can clone the gist, or just copy+paste the code:
| This entry was posted on Tuesday, October 13th, 2009 at 16:27 and is filed under Random. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site. |
[...] Planet !Mandriva: http://blog.zerodogg.org/2009/10/13/sanity-checking-mason/ !gnu [...]
[...] original post here: Sanity checking mason By admin | category: Script??????? | tags: mario, missing-the-old, myself-doing, [...]
I was looking for exactly this kind of tool. What happened to the code?