diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-10-02 12:16:42 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-10-02 12:16:42 -0500 |
commit | 0722287d6c04831cdb40b64bae2ca55c24c2f555 (patch) | |
tree | 751d92348e4635bf845e1edc1df027fa32b3c4c2 /lib/Text/Handlebars.pm | |
parent | 2986df9f1eef1112b2221a52bf0a025611ec4e09 (diff) | |
download | text-handlebars-0722287d6c04831cdb40b64bae2ca55c24c2f555.tar.gz text-handlebars-0722287d6c04831cdb40b64bae2ca55c24c2f555.zip |
handle inverted sections
Diffstat (limited to 'lib/Text/Handlebars.pm')
-rw-r--r-- | lib/Text/Handlebars.pm | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Text/Handlebars.pm b/lib/Text/Handlebars.pm index bad8c64..aa239a0 100644 --- a/lib/Text/Handlebars.pm +++ b/lib/Text/Handlebars.pm @@ -12,6 +12,10 @@ sub default_functions { my ($val) = @_; return ref($val) && ref($val) eq 'ARRAY'; }, + '(is_empty_array)' => sub { + my ($val) = @_; + return @$val == 0; + }, '(make_array)' => sub { my ($length) = @_; return [(undef) x $length]; |