line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sys::Info::Constants; |
2
|
|
|
|
|
|
|
$Sys::Info::Constants::VERSION = '0.7807'; |
3
|
1
|
|
|
1
|
|
68391
|
use strict; |
|
1
|
|
|
|
|
14
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp qw( croak ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
7
|
1
|
|
|
1
|
|
6
|
use base qw( Exporter ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
278
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
BEGIN { |
10
|
1
|
50
|
|
1
|
|
6
|
if ( ! defined &OSID ) { |
11
|
1
|
|
|
|
|
5
|
my %OS = ( |
12
|
|
|
|
|
|
|
MSWin32 => 'Windows', |
13
|
|
|
|
|
|
|
MSWin64 => 'Windows', |
14
|
|
|
|
|
|
|
linux => 'Linux', |
15
|
|
|
|
|
|
|
darwin => 'OSX', |
16
|
|
|
|
|
|
|
); |
17
|
1
|
|
|
|
|
4
|
$OS{$_} = 'BSD' for qw( freebsd openbsd netbsd ); |
18
|
1
|
|
50
|
|
|
7
|
my $ID = $OS{ $^O } || 'Unknown'; |
19
|
2
|
|
|
2
|
|
160
|
*OSID = sub () { "$ID" } |
20
|
1
|
|
|
|
|
25
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
1
|
|
7
|
use constant DCPU_LOAD_LAST_01 => 0; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
63
|
|
24
|
1
|
|
|
1
|
|
6
|
use constant DCPU_LOAD_LAST_05 => 1; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
51
|
|
25
|
1
|
|
|
1
|
|
6
|
use constant DCPU_LOAD_LAST_10 => 2; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
52
|
|
26
|
1
|
|
|
1
|
|
5
|
use constant DCPU_LOAD => (0..2); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
72
|
|
27
|
|
|
|
|
|
|
|
28
|
1
|
|
|
1
|
|
6
|
use constant WIN_REG_HW_KEY => 'HKEY_LOCAL_MACHINE/HARDWARE/'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
60
|
|
29
|
1
|
|
|
|
|
57
|
use constant WIN_REG_CPU_KEY => WIN_REG_HW_KEY |
30
|
1
|
|
|
1
|
|
6
|
. q{DESCRIPTION/System/CentralProcessor}; |
|
1
|
|
|
|
|
2
|
|
31
|
1
|
|
|
|
|
50
|
use constant WIN_REG_CDKEY => q{HKEY_LOCAL_MACHINE/Software/Microsoft/} |
32
|
1
|
|
|
1
|
|
7
|
. q{Windows NT/CurrentVersion//DigitalProductId}; |
|
1
|
|
|
|
|
1
|
|
33
|
1
|
|
|
1
|
|
5
|
use constant WIN_REG_OCDKEY => q{HKEY_LOCAL_MACHINE/Software/Microsoft/Office}; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
34
|
1
|
|
|
1
|
|
5
|
use constant WIN_WMI_DATE_TMPL => 'A4 A2 A2 A2 A2 A2'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
67
|
|
35
|
1
|
|
|
1
|
|
6
|
use constant WIN_B24_DIGITS => qw( B C D F G H J K M P Q R T V W X Y 2 3 4 6 7 8 9 ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
65
|
|
36
|
1
|
|
|
1
|
|
6
|
use constant WIN_USER_INFO_LEVEL => 3; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
69
|
|
37
|
|
|
|
|
|
|
|
38
|
1
|
|
|
1
|
|
7
|
use constant DATE_WEEKDAYS => qw( Sun Mon Tue Wed Thu Fri Sat ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
60
|
|
39
|
1
|
|
|
1
|
|
7
|
use constant DATE_MONTHS => qw( Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ); |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
49
|
|
40
|
1
|
|
|
1
|
|
6
|
use constant DATE_MKTIME_YDAY => 0; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
49
|
|
41
|
1
|
|
|
1
|
|
5
|
use constant DATE_MKTIME_ISDST => -1; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
64
|
|
42
|
|
|
|
|
|
|
|
43
|
1
|
|
|
1
|
|
6
|
use constant UN_RE_BUILD => qr{\A Build \s+ (\d+) .* \z}xmsi; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
57
|
|
44
|
|
|
|
|
|
|
|
45
|
1
|
|
|
1
|
|
23
|
use constant NEW_PERL => $] >= 5.008; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
68
|
|
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
1
|
|
7
|
use constant USER_REAL_NAME_FIELD => 6; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
172
|
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
50
|
|
|
|
|
|
|
device_cpu => [qw/ |
51
|
|
|
|
|
|
|
DCPU_LOAD_LAST_01 |
52
|
|
|
|
|
|
|
DCPU_LOAD_LAST_05 |
53
|
|
|
|
|
|
|
DCPU_LOAD_LAST_10 |
54
|
|
|
|
|
|
|
DCPU_LOAD |
55
|
|
|
|
|
|
|
/], |
56
|
|
|
|
|
|
|
windows_reg => [qw/ |
57
|
|
|
|
|
|
|
WIN_REG_HW_KEY |
58
|
|
|
|
|
|
|
WIN_REG_CPU_KEY |
59
|
|
|
|
|
|
|
WIN_REG_CDKEY |
60
|
|
|
|
|
|
|
WIN_REG_OCDKEY |
61
|
|
|
|
|
|
|
/], |
62
|
|
|
|
|
|
|
windows_wmi => [qw/ |
63
|
|
|
|
|
|
|
WIN_WMI_DATE_TMPL |
64
|
|
|
|
|
|
|
/], |
65
|
|
|
|
|
|
|
windows_etc => [qw/ |
66
|
|
|
|
|
|
|
WIN_B24_DIGITS |
67
|
|
|
|
|
|
|
WIN_USER_INFO_LEVEL |
68
|
|
|
|
|
|
|
/], |
69
|
|
|
|
|
|
|
date => [qw/ |
70
|
|
|
|
|
|
|
DATE_WEEKDAYS |
71
|
|
|
|
|
|
|
DATE_MONTHS |
72
|
|
|
|
|
|
|
DATE_MKTIME_YDAY |
73
|
|
|
|
|
|
|
DATE_MKTIME_ISDST |
74
|
|
|
|
|
|
|
/], |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
unknown => [qw/ |
77
|
|
|
|
|
|
|
UN_RE_BUILD |
78
|
|
|
|
|
|
|
/], |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
general => [qw/ |
81
|
|
|
|
|
|
|
OSID |
82
|
|
|
|
|
|
|
NEW_PERL |
83
|
|
|
|
|
|
|
USER_REAL_NAME_FIELD |
84
|
|
|
|
|
|
|
/], |
85
|
|
|
|
|
|
|
); |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
our @EXPORT_OK = map { @{ $_ } } values %EXPORT_TAGS; |
88
|
|
|
|
|
|
|
$EXPORT_TAGS{all} = \@EXPORT_OK; |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
1; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
__END__ |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=pod |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=encoding UTF-8 |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=head1 NAME |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Sys::Info::Constants |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 VERSION |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
version 0.7807 |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 SYNOPSIS |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
use Sys::Info::Constants qw( :device_cpu ); |
109
|
|
|
|
|
|
|
printf "CPU Load: %s\n", $cpu->load(DCPU_LOAD_LAST_01); |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head1 DESCRIPTION |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
This module defines all the constants used inside C<Sys::Info> and it's |
114
|
|
|
|
|
|
|
subclasses. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 NAME |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
Sys::Info::Constants - Constants for Sys::Info |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head1 CONSTANTS |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
Every constant can be imported individually or via import keys: |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
Import Key Constant |
125
|
|
|
|
|
|
|
------------ ----------------- |
126
|
|
|
|
|
|
|
:device_cpu DCPU_LOAD_LAST_01 |
127
|
|
|
|
|
|
|
DCPU_LOAD_LAST_05 |
128
|
|
|
|
|
|
|
DCPU_LOAD_LAST_10 |
129
|
|
|
|
|
|
|
DCPU_LOAD |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
:windows_reg WIN_REG_HW_KEY |
132
|
|
|
|
|
|
|
WIN_REG_CPU_KEY |
133
|
|
|
|
|
|
|
WIN_REG_CDKEY |
134
|
|
|
|
|
|
|
WIN_REG_OCDKEY |
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
:windows_wmi WIN_WMI_DATE_TMPL |
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
:windows_etc WIN_B24_DIGITS |
139
|
|
|
|
|
|
|
WIN_USER_INFO_LEVEL |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
:date DATE_WEEKDAYS |
142
|
|
|
|
|
|
|
DATE_MONTHS |
143
|
|
|
|
|
|
|
DATE_MKTIME_YDAY |
144
|
|
|
|
|
|
|
DATE_MKTIME_ISDST |
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
:general OSID |
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=head2 OSID |
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
The Operating System name used inside all C<Sys::Info> modules. |
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=head1 SEE ALSO |
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
L<Sys::Info>. |
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head1 AUTHOR |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
Burak Gursoy <burak@cpan.org> |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
This software is copyright (c) 2006 by Burak Gursoy. |
163
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
165
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=cut |