App-Sys-Info

 view release on metacpan or  search on metacpan

lib/App/Sys/Info.pm  view on Meta::CPAN

package App::Sys::Info;
$App::Sys::Info::VERSION = '0.26';
use strict;
use warnings;

use constant CP_UTF8      => 65_001;
use constant LAST_ELEMENT =>     -1;

use Carp                 qw( croak    );
use Format::Human::Bytes;
use POSIX                qw( locale_h );
use Text::Table          qw();
use Time::Duration       qw( duration_exact  );
use Sys::Info            qw();
use Sys::Info::Constants qw( NEW_PERL OSID );

my($NEED_CHCP, $OLDCP);

BEGIN {
    no strict qw( refs );
    foreach my $id ( qw( info os cpu fhb meta NA ) ) {

lib/App/Sys/Info.pm  view on Meta::CPAN

    system chcp => $enc, '2>nul', '1>nul';
    return;
}

sub new {
    my $class  = shift;
    my $i      = Sys::Info->new;
    my $loc    = do {
        my $rv;
        eval {
            $rv = setlocale( LC_CTYPE );
            1;
        } or do {
            my $error = $@ || 'Unknown error';
            warn "Unable to collect the locale information: $error";
            $rv = '';
        };
        $rv;
    };
    my $self   = {
        LOCALE => $loc,
        NA     => 'N/A',
        info   => $i,
        os     => $i->os,
        cpu    => $i->device('CPU'),



( run in 0.875 second using v1.01-cache-2.11-cpan-ceb78f64989 )