http://qs1969.pair.com?node_id=1219779


in reply to Re^3: Devel::Declare is deprecated, what’s instead? (Keyword::Simple)
in thread Devel::Declare is deprecated, what’s instead?

That's interesting, thank you. I tried to hack Keyword::Simple to return _EXPR, but that expectedly fails because it also creates a single OP_NULL as a statement returned, and that doesn't fly in the expression context. Also, I checked XS::APItest::KeywordRPN that is mentioned in the docs as a reference implementation of a keyword handler, and although it's broken now, it uses _EXPR that supposedly worked at least on 5.13.

But that leads to another question: I wonder how one compiles perl code to get a optree? If it exists, then Keyword::Simple would be relatively simple to expand, I guess.