1System::Info::Base(3) User Contributed Perl DocumentationSystem::Info::Base(3)
2
3
4
6 System::Info::Base - Baseclass for system information.
7
9 cpu
10 cpu_type
11 ncpu
12 os
13 host
15 System::Info::Base->new()
16 Return a new instance for $^O
17
18 $si->prepare_sysinfo
19 This method should be overridden by platform specific subclasses.
20
21 The generic information is taken from "POSIX::uname()".
22
23 $self->_hostname => (POSIX::uname)[1]
24 $self->_os => join " - " => (POSIX::uname)[0,2]
25 $self->_osname => (POSIX::uname)[0]
26 $self->_osvers => (POSIX::uname)[2]
27 $self->_cpu_type => (POSIX::uname)[4]
28 $self->_cpu => (POSIX::uname)[4]
29 $self->_cpu_count => ""
30
31 $si->get_os
32 Returns $self->_os
33
34 $si->get_hostname
35 Returns $self->_hostname
36
37 $si->get_cpu_type
38 Returns $self->_cpu_type
39
40 $si->get_cpu
41 Returns $self->_cpu
42
43 $si->get_cpu_count
44 Returns $self->_cpu_count
45
46 $si->get_core_count
47 Returns $self->get_cpu_count as a number
48
49 If "get_cpu_count" returns "2 [8 cores]", "get_core_count" returns 8
50
51 si_uname (@args)
52 This class gathers most of the uname(1) info, make a comparable
53 version. Takes almost the same arguments:
54
55 a for all (can be omitted)
56 n for nodename
57 s for os name and version
58 m for cpu name
59 c for cpu count
60 p for cpu_type
61
62 $si->old_dump
63 Just a backward compatible way to dump the object (for test suite).
64
66 (c) 2016-2018, Abe Timmerman & H.Merijn Brand, All rights reserved.
67
68 With contributions from Jarkko Hietaniemi, Campo Weijerman, Alan
69 Burlison, Allen Smith, Alain Barbet, Dominic Dunlop, Rich Rauenzahn,
70 David Cantrell.
71
72 This library is free software; you can redistribute it and/or modify it
73 under the same terms as Perl itself.
74
75 See:
76
77 · <http://www.perl.com/perl/misc/Artistic.html>
78
79 · <http://www.gnu.org/copyleft/gpl.html>
80
81 This program is distributed in the hope that it will be useful, but
82 WITHOUT ANY WARRANTY; without even the implied warranty of
83 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
84
85
86
87perl v5.28.1 2018-01-16 System::Info::Base(3)