I'm looking to play with perl parser manipulation. It looks like the various B::Hooks
modules are what people use. I was wondering:
Best place to start for someone who has no
XS
experience (yet). Any relevant blog posts?How much work would be involved in creating a new operator, for example:
$a~>one~>two~>three
~>
would work like ->
but it would not try to call on undef
and would instead simply return undef
to LHS.
Although a source filter would work -- I'm more interested in seeing how you can manipulate the parser at a deeper level.
if( $dom->at('div')->at('h1')) {
in Mojo::DOM and getting can't call undefined becasuediv
didn't exist :) – Parmesanautobox
? A very simple package with a fundamentalAUTOLOAD
routine would suffice. You wouldn't have a new operator, but adding all possible methods there are toundef
. This would probably have terrible performance impacts. Like this:use autobox UNDEF => 'SilentUndef'; … your code… package SilentUndef; sub AUTOLOAD {sub{}}
. – Idealism