http://www.perlmonks.org?node_id=515439

Thilosophy has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks,

I have just stumbled upon a blog entry about a technology that I had never heard of before, but that is apparently being widely implemented in the JavaScript world (Rhino 1.6 has it, Firefox 1.5 has it, Flash ActionScript 3 will have it): E4X -- ECMAScript for XML -- Native XML for JavaScript.

* var order = <order><customer>. . .</customer> <item><price>5</price><qty>10</qty></item> <item level="rush"> <price>2.5</price> <qty>30</qty> </item> <item level="rush"> <price>1.5</price> <qty>50</qty> </item> </order>; * var items = order.item; // XMLList of item el'ts * var prices = order..price; * var urgentItems = order.item.(@level == "rush"); * var itemAttrs = order.item[0].@*;

Basically E4X allows you to work with (and even embed) XML into JavaScript in a very straightforward fashion. In fact, the whole approach (especially the XML-here-doc/interpolation facility) strikes me as very Perlish, but a quick googling and a super-search here turned up nothing for "e4x perl".

My question is: are there plans to support E4X in Perl (not necessarily as a core feature, but as a module, and only as far is it is syntactically compatible), and is there already something similar to it in the Perl world.?

code sample taken from Brendan Eich's presentation at XTech 05