blib/lib/Acme/MetaSyntactic/services.pm

filter: Statementstmt 64.7% 11 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 2 / 3 Podpod n/a totaltotal 65.0% 13 / 20 CC 1 SCAR 2.9
CC
1
Cov
65%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« blib/lib/Acme/MetaSyntactic/us_presidents.pm ↑ Summary blib/lib/Acme/MetaSyntactic/tld.pm »
1 package Acme::MetaSyntactic::services;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use Acme::MetaSyntactic::List;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 our @ISA = qw( Acme::MetaSyntactic::List );
5 2 our $VERSION = '1.007';
6 2 __PACKAGE__->init();
7  
8 our %Remote = (
9 source => 'http://www.insecure.org/nmap/data/nmap-services',
10 extract => sub {
11 0 return grep {/^\D/}
12 0 ▶ map { s/[#\s].*//; y!-:.+/*!_!; s/__+/_/g; $_ }
Subroutine __ANON__: not called CC=1 SCAR=6.9
13 $_[0] =~ m!^(\S+)!gm;
14 },
15 2 );
16  
17 2 1;
18  
19 =head1 NAME
20  
21 Acme::MetaSyntactic::services - The services theme
22  
23 =head1 DESCRIPTION
24  
25 The names of the services usually found in F</etc/services>.
26  
27 The first list came from my Debian system and was extracted with:
28  
29 perl -lane '$_=$F[0];y/-/_/;!/#/&&!$s{$_}++&&print' /etc/services
30  
31 Which was then golfed down to:
32  
33 perl -lane '$_=$F[0];y/-/_/;!/#/&&$s{$_}++||print' /etc/services
34 perl -lane '$_=$F[0];y/-/_/;/#/||$s{$_}++||print' /etc/services
35 perl -ne 's/\s.*//;y/-/_/;/#/||$s{$_}++||print' /etc/services
36 perl -pe 's/[#\s].*//;y/-/_/;$s{$_}++&&goto LINE' /etc/services
37 perl -ne 's/[#\s].*//;y/-/_/;$s{$_}++||print' /etc/services
38  
39 For version 0.68, this was golfed a little more, by using the symbol
40 table as the hash table it is:
41  
42 perl -ne 's/[#\s].*//;y/-/_/;$$_++||print' /etc/services
43  
44 The reference list is given by the IANA, and available at
45 L<http://www.iana.org/assignments/port-numbers>.
46  
47 A bigger services lists is used by B<nmap>:
48 L<http://www.insecure.org/nmap/data/nmap-services>.
49 This list is used to update the theme.
50  
51 =head1 CONTRIBUTOR
52  
53 Philippe "BooK" Bruhat.
54  
55 =head1 CHANGES
56  
57 =over 4
58  
59 =item *
60  
61 2019-07-29 - v1.007
62  
63 Updated from the source web site in Acme-MetaSyntactic-Themes version 1.053.
64  
65 =item *
66  
67 2018-10-29 - v1.006
68  
69 Updated from the source web site in Acme-MetaSyntactic-Themes version 1.052.
70  
71 =item *
72  
73 2017-06-12 - v1.005
74  
75 Updated from the source web site in Acme-MetaSyntactic-Themes version 1.050.
76  
77 =item *
78  
79 2015-10-19 - v1.004
80  
81 Updated from the source web site in Acme-MetaSyntactic-Themes version 1.048.
82  
83 =item *
84  
85 2015-06-08 - v1.003
86  
87 Updated from the source web site in Acme-MetaSyntactic-Themes version 1.046.
88  
89 =item *
90  
91 2014-10-13 - v1.002
92  
93 Updated from the source web site in Acme-MetaSyntactic-Themes version 1.043.
94  
95 =item *
96  
97 2014-08-18 - v1.001
98  
99 Changed the source link to use the services list from nmap,
100 as the I<graffiti.com> site seems to have disappeared.
101  
102 Updated from the source web site in Acme-MetaSyntactic-Themes version 1.041.
103  
104 =item *
105  
106 2012-05-07 - v1.000
107  
108 Received its own version number in Acme-MetaSyntactic-Themes version 1.000.
109  
110 =item *
111  
112 2006-07-24
113  
114 Updated with a link to the IANA list in Acme-MetaSyntactic version 0.84.
115  
116 =item *
117  
118 2006-04-03
119  
120 Updated and made automatically updatable with the I<graffiti.com> list
121 in Acme-MetaSyntactic version 0.68.
122  
123 This increased the theme size by a factor of 14.
124  
125 =item *
126  
127 2005-08-01
128  
129 Introduced in Acme-MetaSyntactic version 0.33, published on August 1, 2005.
130  
131 I got the idea for this list on IRC, on the day it was published.
132  
133 =back
134  
135 =head1 SEE ALSO
136  
137 L<Acme::MetaSyntactic>, L<Acme::MetaSyntactic::List>.
138  
139 =cut
140  
141 __DATA__
« blib/lib/Acme/MetaSyntactic/us_presidents.pm ↑ Summary blib/lib/Acme/MetaSyntactic/tld.pm »