in reply to Re^3: Data::Rmap to modify an arrayref of arrayrefs
in thread Data::Rmap to modify an arrayref of arrayrefs



My attempt to rewrite the array at the level of the item I wanted to introduced a subtle flaw. I made it clear what data structure I wanted:
[ 'note', [ 'shopping', [ 'item', 'bread' ], [ 'item', 'butter' ], [ 'item', 'beans' ] ] ];
but then the code above introduces an extra level of array referencing that is not acceptable:
[ 'note', [ 'shopping', [ [ 'item', 'bread' ], [ 'item', 'butter' ], [ 'item', 'beans' ] ] ] ];
it looks like I will have to write the child list at the level of the parent instead of rewriting at the level of the child.


The mantra of every experienced web application developer is the same: thou shalt separate business logic from display. Ironically, almost all template engines allow violation of this separation principle, which is the very impetus for HTML template engine development.

-- Terence Parr, "Enforcing Strict Model View Separation in Template Engines"