line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
60369
|
use strictures 1; |
|
1
|
|
|
|
|
8
|
|
|
1
|
|
|
|
|
27
|
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Provides IO::All |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Syntax::Feature::Io; |
6
|
|
|
|
|
|
|
BEGIN { |
7
|
1
|
|
|
1
|
|
138
|
$Syntax::Feature::Io::VERSION = '0.001'; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
BEGIN { |
10
|
1
|
|
|
1
|
|
20
|
$Syntax::Feature::Io::AUTHORITY = 'cpan:PHAYLON'; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
|
1
|
|
803
|
use Params::Classify 0.013 qw( is_ref ); |
|
1
|
|
|
|
|
2166
|
|
|
1
|
|
|
|
|
86
|
|
14
|
1
|
|
|
1
|
|
7
|
use Carp qw( croak ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
48
|
|
15
|
1
|
|
|
1
|
|
5
|
use Sub::Install 0.925 qw( install_sub ); |
|
1
|
|
|
|
|
16
|
|
|
1
|
|
|
|
|
9
|
|
16
|
1
|
|
|
1
|
|
7080
|
use IO::All 0.41 (); |
|
1
|
|
|
|
|
13844
|
|
|
1
|
|
|
|
|
31
|
|
17
|
1
|
|
|
1
|
|
9
|
use B::Hooks::EndOfScope 0.09; |
|
1
|
|
|
|
|
28
|
|
|
1
|
|
|
|
|
10
|
|
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
82
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
7
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
$Carp::Internal{ +__PACKAGE__ }++; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub install { |
26
|
6
|
|
|
6
|
1
|
31474
|
my ($class, %args) = @_; |
27
|
6
|
|
|
|
|
12
|
my $target = $args{into}; |
28
|
6
|
|
|
|
|
11
|
my $options = $args{options}; |
29
|
6
|
100
|
|
|
|
20
|
$options = { -import => $options } |
30
|
|
|
|
|
|
|
if is_ref $options, 'ARRAY'; |
31
|
6
|
100
|
|
|
|
14
|
$options = {} |
32
|
|
|
|
|
|
|
unless defined $options; |
33
|
6
|
100
|
|
|
|
159
|
croak qq{Options for $class have to be in array or hash ref} |
34
|
|
|
|
|
|
|
unless is_ref $options, 'HASH'; |
35
|
|
|
|
|
|
|
$options->{ -import } = [] |
36
|
5
|
100
|
|
|
|
15
|
unless defined $options->{ -import }; |
37
|
|
|
|
|
|
|
croak qq{Option -import for $class has to be array ref} |
38
|
5
|
100
|
|
|
|
144
|
unless is_ref $options->{ -import }, 'ARRAY'; |
39
|
4
|
|
|
|
|
6
|
my $name = $options->{ -as }; |
40
|
4
|
100
|
|
|
|
8
|
$name = 'io' |
41
|
|
|
|
|
|
|
unless defined $name; |
42
|
|
|
|
|
|
|
install_sub { |
43
|
|
|
|
|
|
|
into => $target, |
44
|
|
|
|
|
|
|
as => $name, |
45
|
|
|
|
|
|
|
code => IO::All |
46
|
4
|
|
|
|
|
5
|
->generate_constructor(@{ $options->{ -import } }), |
|
4
|
|
|
|
|
19
|
|
47
|
|
|
|
|
|
|
}; |
48
|
|
|
|
|
|
|
on_scope_end { |
49
|
4
|
|
|
4
|
|
285
|
namespace::clean->clean_subroutines($name); |
50
|
4
|
|
|
|
|
243
|
}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=pod |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 NAME |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Syntax::Feature::Io - Provides IO::All |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 VERSION |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
version 0.001 |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 SYNOPSIS |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
use syntax qw( io ); |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
my @own_lines = io(__FILE__)->getlines; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=head1 DESCRIPTION |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
This is a syntax feature extension for L providing L. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Not much additional use is provided, besides much easier access if you are |
79
|
|
|
|
|
|
|
already using L in one way or another. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 METHODS |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head2 install |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
$class->install( %arguments ) |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Used by L to install the extension in the requesting namespace. |
88
|
|
|
|
|
|
|
Only the arguments C and C are recognized. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 OPTIONS |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head2 -import |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
use syntax io => { -import => [-strict] }; |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
You can use this option to pass import flags to L. Since this is |
97
|
|
|
|
|
|
|
the option you'll most likely use, if any, you can skip the hash reference |
98
|
|
|
|
|
|
|
and provide the import list directly if you wish: |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
use syntax io => [-strict]; |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Please see L for documentation on the import arguments. |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=head2 -as |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
use syntax io => { -as => 'IO' }; |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
my @own_lines = IO(__FILE)->getlines; |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Set the name of the import. |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 SEE ALSO |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=over |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=item * L |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=item * L |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=back |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 BUGS |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Please report any bugs or feature requests to bug-syntax-feature-io@rt.cpan.org or through the web interface at: |
125
|
|
|
|
|
|
|
http://rt.cpan.org/Public/Dist/Display.html?Name=Syntax-Feature-Io |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 AUTHOR |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Robert 'phaylon' Sedlacek |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
This software is copyright (c) 2011 by Robert 'phaylon' Sedlacek. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
136
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=cut |
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
__END__ |