| 1 | package Unix::Uptime; | ||||||||||
| 2 | |||||||||||
| 3 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 4 | our $VERSION='0.36'; | |||||||||
| 7 | 4 | $VERSION = eval $VERSION; | |||||||||
| 8 | |||||||||||
| 9 | 4 | my %modules = ( | |||||||||
| 10 | freebsd => 'FreeBSD', | ||||||||||
| 11 | dragonfly => 'FreeBSD', | ||||||||||
| 12 | linux => 'Linux', | ||||||||||
| 13 | openbsd => 'BSD', | ||||||||||
| 14 | darwin => 'BSD', | ||||||||||
| 15 | netbsd => 'BSD', | ||||||||||
| 16 | ); | ||||||||||
| 17 | |||||||||||
| 18 | 4 | ▶ | my $module = $modules{$^O} | ||||||||
|
Branch: 1 branch
| |||||||||||
| 19 | or die "Operating system type $^O is currently unsupported"; | ||||||||||
| 20 | |||||||||||
| 21 | 4 | require "Unix/Uptime/$module.pm"; | |||||||||
| 22 | 4 | our @ISA = ("Unix::Uptime::$module"); | |||||||||
| 23 | |||||||||||
| 24 | 4 | my $hires; | |||||||||
| 25 | |||||||||||
| 26 | sub want_hires { | ||||||||||
| 27 | 2 | ▶ | my $class = shift; | ||||||||
|
Subroutine
want_hires: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 28 | |||||||||||
| 29 | 2 | return $hires; | |||||||||
| 30 | } | ||||||||||
| 31 | |||||||||||
| 32 | sub import { | ||||||||||
| 33 | 4 | ▶ | my $class = shift; | ||||||||
|
Subroutine
import: called CC=3 SCAR=11.0
| |||||||||||
| 34 | 4 | ▶ | if (grep {$_ eq ':hires'} @_) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | 1 | $hires = 1; | |||||||||
| 36 | 1 | $module = "Unix::Uptime::$module"; | |||||||||
| 37 | 1 | ▶ | $module->can('load_hires') | ||||||||
|
Branch: 1 branch
| |||||||||||
| 38 | and $module->load_hires(); | ||||||||||
| 39 | } | ||||||||||
| 40 | } | ||||||||||
| 41 | |||||||||||
| 42 | 4 | 1; | |||||||||
| 43 | |||||||||||
| 44 | __END__ | ||||||||||