line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Perl::ToPerl6::Utils::Perl; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
3350
|
use 5.006001; |
|
1
|
|
|
|
|
2
|
|
4
|
1
|
|
|
1
|
|
3
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
16
|
|
5
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
3
|
use Exporter 'import'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
122
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
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
|
6
|
|
|
6
|
1
|
2741
|
my ($symbol) = @_; |
25
|
|
|
|
|
|
|
|
26
|
6
|
|
|
|
|
23
|
(my $without_sigil = $symbol) =~ s< \A [\$@%*&] ><>xms; |
27
|
|
|
|
|
|
|
|
28
|
6
|
|
|
|
|
23
|
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::ToPerl6::Utils::Perl - Utility functions for dealing with Perl language issues. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 SYNOPSIS |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
use Perl::ToPerl6::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 : |