line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acpi::Class::Attributes; |
2
|
|
|
|
|
|
|
{ |
3
|
|
|
|
|
|
|
$Acpi::Class::Attributes::VERSION = '0.003'; |
4
|
|
|
|
|
|
|
} |
5
|
|
|
|
|
|
|
# ABSTRACT: Creates a HashRef with the filenames of a directory and its contents. |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# use {{{ |
8
|
2
|
|
|
2
|
|
31726
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
91
|
|
9
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
59
|
|
10
|
2
|
|
|
2
|
|
914
|
use Object::Tiny::XS qw( path ); |
|
2
|
|
|
|
|
4632
|
|
|
2
|
|
|
|
|
13
|
|
11
|
2
|
|
|
2
|
|
10902
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
584
|
|
12
|
|
|
|
|
|
|
#}}} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub attributes #{{{ |
15
|
|
|
|
|
|
|
{ |
16
|
|
|
|
|
|
|
# Get the parameters from $dir |
17
|
1
|
|
|
1
|
0
|
27
|
my $self = shift; |
18
|
1
|
|
|
|
|
4
|
my $dir = $self->path; |
19
|
|
|
|
|
|
|
|
20
|
1
|
50
|
|
|
|
130
|
opendir (my $device, $dir) or croak "The class/device '$dir' does not exist in your system. \n"; |
21
|
1
|
|
|
|
|
3
|
my %attributes; |
22
|
1
|
|
|
|
|
24
|
while (readdir($device)) |
23
|
|
|
|
|
|
|
{ |
24
|
|
|
|
|
|
|
|
25
|
5
|
100
|
|
|
|
148
|
if (-f "$dir/$_") |
26
|
|
|
|
|
|
|
{ |
27
|
|
|
|
|
|
|
my $content = do |
28
|
2
|
|
|
|
|
4
|
{ |
29
|
2
|
|
|
|
|
9
|
local @ARGV = "$dir/$_"; |
30
|
2
|
|
|
|
|
171
|
local $/ = ; |
31
|
|
|
|
|
|
|
}; |
32
|
2
|
50
|
|
|
|
9
|
chomp $content if defined $content; |
33
|
2
|
|
|
|
|
11
|
$attributes{$_} = $content; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
1
|
|
|
|
|
41
|
return \%attributes; |
37
|
|
|
|
|
|
|
}#}}} |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |