« lib/WWW/Shopify/Liquid/Dialect/Shopify/Tag/Layout.pm
↑ Summary
lib/WWW/Shopify/Liquid/Filter/StripHtml.pm »
| 1 | #!/usr/bin/perl | ||
| 2 | use strict; | ||
| 3 | use warnings; | ||
| 4 | |||
| 5 | package WWW::Shopify::Liquid::Filter::Slice; use base 'WWW::Shopify::Liquid::Filter'; | ||
| 6 | |||
| 7 | sub operate { | ||
| 8 | my ($self, $hash, $operand, $index, $length) = @_; | ||
| 9 | $length = 1 unless defined $length; | ||
| 10 | return substr($operand, $index, $length); | ||
| 11 | } | ||
| 12 | |||
| 13 | 1; |