| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Perl::Critic::Utils::Perl; |
|
2
|
|
|
|
|
|
|
|
|
3
|
40
|
|
|
40
|
|
1321
|
use 5.010001; |
|
|
40
|
|
|
|
|
200
|
|
|
4
|
40
|
|
|
40
|
|
254
|
use strict; |
|
|
40
|
|
|
|
|
123
|
|
|
|
40
|
|
|
|
|
805
|
|
|
5
|
40
|
|
|
40
|
|
224
|
use warnings; |
|
|
40
|
|
|
|
|
144
|
|
|
|
40
|
|
|
|
|
1253
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
40
|
|
|
40
|
|
267
|
use Exporter 'import'; |
|
|
40
|
|
|
|
|
109
|
|
|
|
40
|
|
|
|
|
7102
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.146'; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our @EXPORT_OK = qw( |
|
14
|
|
|
|
|
|
|
symbol_without_sigil |
|
15
|
|
|
|
|
|
|
); |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
|
18
|
|
|
|
|
|
|
all => \@EXPORT_OK, |
|
19
|
|
|
|
|
|
|
); |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub symbol_without_sigil { |
|
24
|
817
|
|
|
817
|
1
|
5712
|
my ($symbol) = @_; |
|
25
|
|
|
|
|
|
|
|
|
26
|
817
|
|
|
|
|
3776
|
(my $without_sigil = $symbol) =~ s< \A [\$@%*&] ><>xms; |
|
27
|
|
|
|
|
|
|
|
|
28
|
817
|
|
|
|
|
4014
|
return $without_sigil; |
|
29
|
|
|
|
|
|
|
} |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
#----------------------------------------------------------------------------- |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
1; |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
__END__ |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=pod |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=for stopwords |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 NAME |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Perl::Critic::Utils::Perl - Utility functions for dealing with Perl language issues. |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
use Perl::Critic::Utils::Perl qw< :all >; |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my $name = symbol_without_sigil('$foo'); # $name is "foo". |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
This handles various issues with Perl, the language, that aren't necessarily |
|
56
|
|
|
|
|
|
|
L<PPI|PPI> related. |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 INTERFACE SUPPORT |
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
This is considered to be a public module. Any changes to its |
|
62
|
|
|
|
|
|
|
interface will go through a deprecation cycle. |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 IMPORTABLE SUBROUTINES |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=over |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item C<symbol_without_sigil( $symbol )> |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Returns the name of the specified symbol with any sigil at the front. |
|
72
|
|
|
|
|
|
|
The parameter can be a vanilla Perl string or a L<PPI::Element|PPI::Element>. |
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=back |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head1 AUTHOR |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Elliot Shank <perl@galumph.com> |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
84
|
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Copyright (c) 2007-2011 Elliot Shank. |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
|
88
|
|
|
|
|
|
|
it under the same terms as Perl itself. The full text of this license |
|
89
|
|
|
|
|
|
|
can be found in the LICENSE file included with this module. |
|
90
|
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=cut |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
# Local Variables: |
|
94
|
|
|
|
|
|
|
# mode: cperl |
|
95
|
|
|
|
|
|
|
# cperl-indent-level: 4 |
|
96
|
|
|
|
|
|
|
# fill-column: 78 |
|
97
|
|
|
|
|
|
|
# indent-tabs-mode: nil |
|
98
|
|
|
|
|
|
|
# c-indentation-style: bsd |
|
99
|
|
|
|
|
|
|
# End: |
|
100
|
|
|
|
|
|
|
# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : |