| 1 | package Devel::Platform::Info::Irix; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 4 | ▶ | use vars qw($VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 4 | $VERSION = '1.00'; | |||||||||
| 8 | |||||||||||
| 9 | #---------------------------------------------------------------------------- | ||||||||||
| 10 | |||||||||||
| 11 | 4 | my %commands = ( | |||||||||
| 12 | '_issue1' => 'cat /etc/issue', | ||||||||||
| 13 | '_issue2' => 'cat /etc/.issue', | ||||||||||
| 14 | '_uname' => 'uname -a', | ||||||||||
| 15 | 'kname' => 'uname -s', | ||||||||||
| 16 | 'kvers' => 'uname -r', | ||||||||||
| 17 | 'osname' => 'uname -o', | ||||||||||
| 18 | 'archname' => 'uname -m', | ||||||||||
| 19 | |||||||||||
| 20 | '_irix1' => 'uname -R', # IRIX specific | ||||||||||
| 21 | ); | ||||||||||
| 22 | |||||||||||
| 23 | #---------------------------------------------------------------------------- | ||||||||||
| 24 | |||||||||||
| 25 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 26 | 0 | my ($class) = @_; | |||||||||
| 27 | 0 | my $self = {}; | |||||||||
| 28 | 0 | bless $self, $class; | |||||||||
| 29 | |||||||||||
| 30 | 0 | return $self; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 0 | ▶ | sub get_info { | ||||||||
|
Subroutine
get_info: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||
| 34 | 0 | my $self = shift; | |||||||||
| 35 | |||||||||||
| 36 | 0 | for my $cmd (keys %commands) { | |||||||||
| 37 | 0 | $self->{cmds}{$cmd} = `$commands{$cmd} 2>/dev/null`; | |||||||||
| 38 | 0 | $self->{cmds}{$cmd} =~ s/\s+$//s; | |||||||||
| 39 | 0 | ▶ | $self->{info}{$cmd} = $self->{cmds}{$cmd} if($cmd !~ /^_/); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 0 | $self->{info}{osflag} = $^O; | |||||||||
| 43 | 0 | $self->{info}{kernel} = lc($self->{info}{kname}) . '-' . $self->{info}{kvers}; | |||||||||
| 44 | 0 | $self->{info}{osname} = 'IRIX'; | |||||||||
| 45 | 0 | $self->{info}{oslabel} = 'IRIX'; | |||||||||
| 46 | 0 | $self->{info}{osvers} = $self->{info}{kvers}; | |||||||||
| 47 | 0 | ▶ | $self->{info}{is32bit} = $self->{info}{kname} !~ /64/ ? 1 : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | 0 | ▶ | $self->{info}{is64bit} = $self->{info}{kname} =~ /64/ ? 1 : 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 49 | |||||||||||
| 50 | 0 | $self->{info}{source}{$commands{$_}} = $self->{cmds}{$_} for(keys %commands); | |||||||||
| 51 | 0 | return $self->{info}; | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | #---------------------------------------------------------------------------- | ||||||||||
| 55 | |||||||||||
| 56 | 4 | 1; | |||||||||
| 57 | |||||||||||
| 58 | __END__ | ||||||||||