perl -c
executes code
#1013
Comments
Good point. As far as I can tell there are three ways to handle this:
Out of these, 1. and 2. don't seem reasonable, and 3. doesn't really offer any protection. Comments? |
Your assessment of the (non)-options seems about right. Definitely not There is PPI, which can parse most perl without There is also the Safe module, but its not Maybe some way to mark certain paths (e.g., ~/home/src/myrepo) as Not the first editor with this problem; see e.g., |
Ok, the PPI seems indeed to parse whatever you throw at it without making any attempt to make sense of the results. This is probably fine for refactoring and the like, but it's less than useful for checking syntax. I haven't looked at Safe. |
I agree that it should be off by default but the command you provided for enabling again (which I kinda want because I tend to have to make small scripts for work/school which are entirely my code) does not seem to do anything for me. There's no way I can get any syntax checking for perl even if I do an explicit :SyntasticCheck. Probably not necessary but here is the piece of config regarding syntastic that I use |
You also need to (re-)add perl to Edit: Why would you people omit the single most important config option to syntastic, is beyond me. Perhaps it should have a better name? |
Oh well tbh I hadn't need to use it before & I was kinda nobraining on the 1 line you mentioned earlier. Probably should have read a bit more before asking, Sorry. |
You should pretty much always add |
An unfortunately little-known fact about
perl -c
is that it actually executes code. From looking at the code, it appears that's how syntastic is doing Perl syntax checking.For example, try
perl -c
on this:perl -c
will print that you're owned.Editing a text file in vim isn't supposed to run it; it should be safe. Unfortunately, an automated
perl -c
on:wq
makes it dangerous.(I haven't looked at any of the other syntax checkers, I don't know how many of them may have similar issues.)
The text was updated successfully, but these errors were encountered: