File Coverage

blib/lib/PPI/Singletons.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package PPI::Singletons;
2              
3             # exports some singleton variables to avoid aliasing magic
4              
5 65     65   451 use strict;
  65         113  
  65         1853  
6 65     65   302 use Exporter ();
  65         133  
  65         34857  
7              
8             our $VERSION = '1.277';
9              
10             our @ISA = 'Exporter';
11             our @EXPORT_OK = qw{ %_PARENT %OPERATOR %MAGIC %LAYER $CURLY_SYMBOL %QUOTELIKE %KEYWORDS };
12              
13             our %_PARENT; # Master Child -> Parent index
14              
15             # operator index
16             our %OPERATOR = map { $_ => 1 } (
17             qw{
18             -> ++ -- ** ! ~ + -
19             =~ !~ * / % x . << >>
20             < > <= >= lt gt le ge
21             == != <=> eq ne cmp ~~
22             & | ^ && || // .. ...
23             ? :
24             = **= += -= .= *= /= %= x= &= |= ^= <<= >>= &&= ||= //=
25             => <> <<>>
26             and or xor not
27             }, ',' # Avoids "comma in qw{}" warning
28             );
29              
30             # Magic variables taken from perlvar.
31             # Several things added separately to avoid warnings.
32             our %MAGIC = map { $_ => 1 } qw{
33             $1 $2 $3 $4 $5 $6 $7 $8 $9
34             $_ $& $` $' $+ @+ %+ $* $. $/ $|
35             $\\ $" $; $% $= $- @- %- $)
36             $~ $^ $: $? $! %! $@ $$ $< $>
37             $( $0 $[ $] @_ @*
38              
39             $^L $^A $^E $^C $^D $^F $^H
40             $^I $^M $^N $^O $^P $^R $^S
41             $^T $^V $^W $^X %^H
42              
43             $::|
44             }, '$}', '$,', '$#', '$#+', '$#-';
45              
46             our %LAYER = ( 1 => [], 2 => [] ); # Registered function store
47              
48             our $CURLY_SYMBOL = qr{\G\^[[:upper:]_]\w+\}};
49              
50             our %QUOTELIKE = (
51             'q' => 'Quote::Literal',
52             'qq' => 'Quote::Interpolate',
53             'qx' => 'QuoteLike::Command',
54             'qw' => 'QuoteLike::Words',
55             'qr' => 'QuoteLike::Regexp',
56             'm' => 'Regexp::Match',
57             's' => 'Regexp::Substitute',
58             'tr' => 'Regexp::Transliterate',
59             'y' => 'Regexp::Transliterate',
60             );
61              
62             # List of keywords is from regen/keywords.pl in the perl source.
63             our %KEYWORDS = map { $_ => 1 } qw{
64             abs accept alarm and atan2 bind binmode bless break caller chdir chmod
65             chomp chop chown chr chroot close closedir cmp connect continue cos
66             crypt dbmclose dbmopen default defined delete die do dump each else
67             elsif endgrent endhostent endnetent endprotoent endpwent endservent
68             eof eq eval evalbytes exec exists exit exp fc fcntl fileno flock for
69             foreach fork format formline ge getc getgrent getgrgid getgrnam
70             gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr
71             getnetbyname getnetent getpeername getpgrp getppid getpriority
72             getprotobyname getprotobynumber getprotoent getpwent getpwnam
73             getpwuid getservbyname getservbyport getservent getsockname
74             getsockopt given glob gmtime goto grep gt hex if index int ioctl join
75             keys kill last lc lcfirst le length link listen local localtime lock
76             log lstat lt m map mkdir msgctl msgget msgrcv msgsnd my ne next no
77             not oct open opendir or ord our pack package pipe pop pos print
78             printf prototype push q qq qr quotemeta qw qx rand read readdir
79             readline readlink readpipe recv redo ref rename require reset return
80             reverse rewinddir rindex rmdir s say scalar seek seekdir select semctl
81             semget semop send setgrent sethostent setnetent setpgrp
82             setpriority setprotoent setpwent setservent setsockopt shift shmctl
83             shmget shmread shmwrite shutdown sin sleep socket socketpair sort
84             splice split sprintf sqrt srand stat state study sub substr symlink
85             syscall sysopen sysread sysseek system syswrite tell telldir tie tied
86             time times tr truncate uc ucfirst umask undef unless unlink unpack
87             unshift untie until use utime values vec wait waitpid wantarray warn
88             when while write x xor y
89             };
90              
91             1;