Ok, so I'm trying to use Text::Sprintf::Named -- I'm looking for the functionality to do something similar to GNU /bin/find's -printf. The catch is I'm using Moose lazy/default, so I don't want the unneeded accessors to be used at all. I'm wondering if there is a pragma or module that changes the way perl works to allow this behavior:
sub value { die 'bad' } my $hash = { "key" => value() } die 'good'
I want that example to die with good. So I'm looking to make a whole hash lazy. I'm kind of just thinking out loud and playing around. I can't return a subref because T::S::N doesn't accept it. Ideally, T::S::N, would also support values deeper in a hash, { key => { title => 'foo', value => 'bar' } } or execute by $obj->$name. ;) If anyone else has done an exercise like this please give your input. I'm writing a printf filter for postgres's EXPLAIN
In reply to Printf in perl / Lazy hash possible? by EvanCarroll
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |