in reply to A key called keys in a hash in Template Toolkit

Add your own vmethod

$tt->context->define_vmethod( hash => vm_keys => \&Template::VMethods::hash_keys );
Then kw.vm_keys.sort works, but naturally it breaks if you define a key called "vm_keys"

You can't have _keys as those are ignored by dodot, they're private

  • Comment on Re: A key called keys in a hash in Template Toolkit (define_vmethod)
  • Download Code