line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DDG::Meta::Helper; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:DDG'; |
3
|
|
|
|
|
|
|
# ABSTRACT: Helper functions for easy access to important functions |
4
|
|
|
|
|
|
|
$DDG::Meta::Helper::VERSION = '1017'; |
5
|
11
|
|
|
11
|
|
109
|
use strict; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
289
|
|
6
|
11
|
|
|
11
|
|
79
|
use warnings; |
|
11
|
|
|
|
|
29
|
|
|
11
|
|
|
|
|
322
|
|
7
|
11
|
|
|
11
|
|
54
|
use Carp qw( croak ); |
|
11
|
|
|
|
|
28
|
|
|
11
|
|
|
|
|
383
|
|
8
|
11
|
|
|
11
|
|
57
|
use Package::Stash; |
|
11
|
|
|
|
|
20
|
|
|
11
|
|
|
|
|
221
|
|
9
|
11
|
|
|
11
|
|
4595
|
use HTML::Entities; |
|
11
|
|
|
|
|
54170
|
|
|
11
|
|
|
|
|
777
|
|
10
|
11
|
|
|
11
|
|
83
|
use URI::Escape; |
|
11
|
|
|
|
|
23
|
|
|
11
|
|
|
|
|
2270
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my %applied; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub apply_keywords { |
16
|
35
|
|
|
35
|
0
|
102
|
my ( $class, $target ) = @_; |
17
|
|
|
|
|
|
|
|
18
|
35
|
50
|
|
|
|
128
|
return if exists $applied{$target}; |
19
|
35
|
|
|
|
|
79
|
$applied{$target} = undef; |
20
|
|
|
|
|
|
|
|
21
|
35
|
|
|
|
|
314
|
my $stash = Package::Stash->new($target); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
35
|
100
|
|
5
|
|
402
|
$stash->add_symbol('&html_enc', sub { return (wantarray) ? map { encode_entities($_) } @_ : encode_entities(join '', @_) }); |
|
5
|
|
|
|
|
6427
|
|
|
5
|
|
|
|
|
57
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
35
|
100
|
|
5
|
|
270
|
$stash->add_symbol('&uri_esc', sub { return (wantarray) ? map { uri_escape($_) } @_ : uri_escape(join '', @_) }); |
|
5
|
|
|
|
|
7672
|
|
|
5
|
|
|
|
|
69
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
35
|
|
|
0
|
|
232
|
$stash->add_symbol('&true', sub { 1 }); |
|
0
|
|
|
|
|
0
|
|
31
|
35
|
|
|
0
|
|
253
|
$stash->add_symbol('&false', sub { 0 }); |
|
0
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
__END__ |