| 1 | package Template::Plugin::Lingua::EN::NameCase; | ||||||||||
| 2 | |||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 6 | ▶ | use vars qw($VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 6 | $VERSION = 0.02; | |||||||||
| 8 | |||||||||||
| 9 | 6 | ▶ | use base qw(Template::Plugin); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 6 | ▶ | use Template::Plugin; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 6 | ▶ | use Template::Stash; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | 6 | ▶ | use Lingua::EN::NameCase qw( nc ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | |||||||||||
| 14 | 6 | $Template::Stash::SCALAR_OPS->{'nc'} = \&_nc; | |||||||||
| 15 | |||||||||||
| 16 | 2 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 17 | 2 | my ($class, $context, $options) = @_; | |||||||||
| 18 | |||||||||||
| 19 | # now define the filter and return the plugin | ||||||||||
| 20 | 2 | $context->define_filter('nc', \&_nc); | |||||||||
| 21 | 2 | return bless {}, $class; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 4 | ▶ | sub _nc { | ||||||||
|
Subroutine
_nc: called CC=2 SCAR=7.2
| |||||||||||
| 25 | 4 | ▶ | my $options = ref $_[-1] eq 'HASH' ? pop : {}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 4 | return nc(join('', @_)); | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | 6 | 1; | |||||||||
| 30 | |||||||||||
| 31 | __END__ | ||||||||||