in reply to Re^3: Undef value in Template Toolkit
in thread Undef value in Template Toolkit

I get your point. Indeed at XY problem, given that there probably are better solutions for this
The goal here was to create a "mapper" from one data source (a data structure from another system) to another (a data structure that "fits" in my system). Something like this:
[% destination.header.address.surname = source.orderData.custI +nfo.surname %] [% destination.header.timestamps.created = methods.tounixtime(sour +ce.orderData.orderDate) %]

This results in a hash structure that is converted to the format my system expects. I.e. So yes, I'm using Template Toolkit to manipulate/process data.

I would agree that TT isn't a good solution for this from a developers point of view. But the end result is _exactly_ what I'm looking for, a simple "configuration file" where the intended user (a system admin that sometimes dynamically needs to change/add fields) can do what he/she needs. If I could find a better solution for it, I would use it ;-)

Replies are listed 'Best First'.
Re^5: Undef value in Template Toolkit
by Fletch (Bishop) on Aug 21, 2019 at 12:56 UTC

    Maybe Data::Diver might help? With that extra context it's only slightly disturbing; the TT syntax makes for a clean-ish approach for doing that.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.