File Coverage

blib/lib/System/Info/VMS.pm
Criterion Covered Total %
statement 12 23 52.1
branch n/a
condition n/a
subroutine 4 6 66.6
pod 2 2 100.0
total 18 31 58.0


line stmt bran cond sub pod time code
1             package System::Info::VMS;
2              
3 2     2   13 use strict;
  2         6  
  2         56  
4 2     2   10 use warnings;
  2         3  
  2         54  
5              
6 2     2   10 use base "System::Info::Base";
  2         4  
  2         196  
7              
8 2     2   14 use POSIX ();
  2         3  
  2         437  
9              
10             our $VERSION = "0.050";
11              
12             =head1 NAME
13              
14             System::Info::VMS - Object for specific VMS info.
15              
16             =head1 DESCRIPTION
17              
18             =head2 $si->prepare_sysinfo
19              
20             Use os-specific tools to find out more about the system.
21              
22             =cut
23              
24             sub prepare_sysinfo {
25 0     0 1   my $self = shift;
26 0           $self->SUPER::prepare_sysinfo;
27              
28 0           my %map = (
29             __cpu => "HW_NAME",
30             __cpu_type => "ARCH_NAME",
31             __cpu_count => "ACTIVECPU_CNT",
32             );
33 0           for my $key (keys %map) {
34 0           chomp (my $cmd_out = `write sys\$output f\$getsyi("$map{$key}")`);
35 0           $self->{$key} = $cmd_out;
36             }
37 0           return $self;
38             } # prepare_sysinfo
39              
40             =head2 $si->prepare_os
41              
42             Use os-specific tools to find out more about the operating system.
43              
44             =cut
45              
46             sub prepare_os {
47 0     0 1   my $self = shift;
48              
49 0           my $os = join " - " => (POSIX::uname ())[0, 3];
50 0           $os =~ s/(\S+)/\L$1/;
51 0           $self->{__os} = $os;
52             } # prepare_os
53              
54             1;
55              
56             __END__