File Coverage

blib/lib/System/Info/Irix.pm
Criterion Covered Total %
statement 9 28 32.1
branch n/a
condition n/a
subroutine 3 5 60.0
pod 2 2 100.0
total 14 35 40.0


line stmt bran cond sub pod time code
1             package System::Info::Irix;
2              
3 2     2   13 use strict;
  2         4  
  2         55  
4 2     2   11 use warnings;
  2         4  
  2         49  
5              
6 2     2   10 use base "System::Info::Base";
  2         4  
  2         870  
7              
8             our $VERSION = "0.050";
9              
10             =head1 NAME
11              
12             System::Info::Irix - Object for specific Irix info.
13              
14             =head1 DESCRIPTION
15              
16             =head2 $si->prepare_sysinfo
17              
18             Use os-specific tools to find out more about the system.
19              
20             =cut
21              
22             sub prepare_sysinfo {
23 0     0 1   my $self = shift;
24 0           $self->SUPER::prepare_sysinfo;
25 0           $self->prepare_os;
26              
27 0           chomp (my ($cpu) = `hinv -t cpu`);
28 0           $cpu =~ s/^CPU:\s+//;
29              
30 0           chomp (my @processor = `hinv -c processor`);
31 0           my ($cpu_cnt) = grep m/\d+.+processors?$/i => @processor;
32 0           my ($cpu_mhz) = $cpu_cnt =~ m/^\d+ (\d+ MHZ) /;
33 0           my $ncpu = (split " " => $cpu_cnt)[0];
34 0           my $type = (split " " => $cpu_cnt)[-2];
35              
36 0           $self->{__cpu_type} = $type;
37 0           $self->{__cpu} = $cpu . " ($cpu_mhz)";
38 0           $self->{__cpu_count} = $ncpu;
39              
40 0           return $self;
41             } # prepare_sysinfo
42              
43             =head2 $si->prepare_os
44              
45             Use os-specific tools to find out more about the operating system.
46              
47             =cut
48              
49             sub prepare_os {
50 0     0 1   my $self = shift;
51              
52 0           chomp (my $osvers = `uname -R`);
53 0           my ($osn, $osv) = ($self->_osname, $self->_osvers);
54 0           $osvers =~ s/^$osv\s+(?=$osv)//;
55 0           $self->{__os} = "$osn - $osvers";
56             } # prepare_os
57              
58             1;
59              
60             __END__