File Coverage

blib/lib/Syntax/Feature/Junction.pm
Criterion Covered Total %
statement 6 11 54.5
branch n/a
condition 0 2 0.0
subroutine 2 3 66.6
pod 0 1 0.0
total 8 17 47.0


line stmt bran cond sub pod time code
1             package Syntax::Feature::Junction;
2              
3 1     1   207084 use strict;
  1         2  
  1         31  
4 1     1   4 use warnings;
  1         1  
  1         138  
5              
6             our $VERSION = '0.003009';
7              
8             require Syntax::Keyword::Junction;
9              
10             sub install {
11 0     0 0   my ($class, %args) = @_;
12              
13 0           my $target = $args{into};
14 0   0       my $options = $args{options} || {};
15              
16 0           Syntax::Keyword::Junction->import({ into => $target }, %$options );
17              
18 0           return 1;
19             }
20              
21             1;
22              
23             __END__
24              
25             =pod
26              
27             =encoding UTF-8
28              
29             =for :stopwords Arthur Axel "fREW" Schmidt Carl Franks
30              
31             =head1 NAME
32              
33             Syntax::Feature::Junction - Provide keywords for any, all, none, or one
34              
35             =head1 SYNOPSIS
36              
37             use syntax 'junction';
38              
39             if (any(@grant) eq 'su') {
40             ...
41             }
42              
43             if (all($foo, $bar) >= 10) {
44             ...
45             }
46              
47             if (qr/^\d+$/ == all(@answers)) {
48             ...
49             }
50              
51             if (all(@input) <= @limits) {
52             ...
53             }
54              
55             if (none(@pass) eq 'password') {
56             ...
57             }
58              
59             if (one(@answer) == 42) {
60             ...
61             }
62              
63             or if you want to rename an export, use L<Sub::Exporter> options:
64              
65             use syntax 'junction' => {
66             any => { -as => 'robot_any' }
67             };
68              
69             if (robot_any(@grant) eq 'su') {
70             ...
71             }
72              
73             The full documentation for this module is in L<Syntax::Keyword::Junction>. This
74             is just a way to use the sugar that L<syntax> gives us.
75              
76             =head1 BUGS
77              
78             Please report any bugs or feature requests on the bugtracker website
79             L<https://github.com/haarg/Syntax-Keyword-Junction/issues>
80              
81             When submitting a bug or request, please include a test-file or a
82             patch to an existing test-file that illustrates the bug or desired
83             feature.
84              
85             =head1 AUTHORS
86              
87             =over 4
88              
89             =item *
90              
91             Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com>
92              
93             =item *
94              
95             Carl Franks
96              
97             =back
98              
99             =head1 COPYRIGHT AND LICENSE
100              
101             This software is copyright (c) 2024 by Arthur Axel "fREW" Schmidt.
102              
103             This is free software; you can redistribute it and/or modify it under
104             the same terms as the Perl 5 programming language system itself.
105              
106             =cut