3 ms·
Source filters are bad because you get a string and parse it yourself and then get it wrong for edge cases. What if Perl already parsed a piece of source for yo
by bmn_ 12y ago
Source filters are bad because you get a string and parse it yourself and then get it wrong for edge cases. What if Perl already parsed a piece of source for you and handed you a data structure instead? That fixes the greatest shortcoming.
Solution 1: B::Deparse <http://yapceurope.lv/ye2011/talk/3597> http://yapceurope.lv/ye2011/talk/3597>, <http://act.yapc.eu/gpw2014/talk/5266> http://act.yapc.eu/gpw2014/talk/5266>
Solution 2: B::CallChecker / <http://perldoc.perl.org/perlapi.html#cv_set_call_checker> http://perldoc.perl.org/perlapi.html#cv_set_call_checker>
In other words, you do have access to the parser. It's not as neat as in Lisp because of the lack of uniform syntax, but still allows for powerful program transformations: <http://p3rl.org/Kavorka::Manual::Signatures> http://p3rl.org/Kavorka::Manual::Signatures>