---
name: "Sys::Info::Base"
section: "3pm"
platform: "linux"
package: "libsys-info-base-perl"
version: "0.7807-4"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Sys::Info::Base"
---

# Sys::Info::Base(3pm)

Base class for Sys::Info

## NAME

Sys::Info::Base

## VERSION

version 0.7807

## SYNOPSIS

```
    use base qw(Sys::Info::Base);
    #...
    sub foo {
        my $self = shift;
        my $data = $self->slurp("/foo/bar.txt");
    }
```

## DESCRIPTION

Includes some common methods.

## NAME

Sys::Info::Base - Base class for Sys::Info

## METHODS

### load\_module CLASS

Loads the module named with `"CLASS"`.

### load\_subclass TEMPLATE

Loads the specified class via `"TEMPLATE"`:

```
    my $class = __PACKAGE__->load_subclass('Sys::Info::Driver::%s::OS');
```

`%s` will be replaced with `"OSID"`. Apart from the template usage, it is the same as `"load_module"`.

### trim STRING

Returns the trimmed version of `"STRING"`.

### slurp FILE

Caches all contents of `"FILE"` into a scalar and then returns it.

### read\_file FILE

Caches all contents of `"FILE"` into an array and then returns it.

### date2time DATE\_STRING

Converts `"DATE_STRING"` into unix timestamp.

### uname

Returns a hashref built from `"POSIX::uname"`.

## SEE ALSO

Sys::Info.

## AUTHOR

Burak Gursoy \<burak@cpan.org\>

## COPYRIGHT AND LICENSE

This software is copyright (c) 2006 by Burak Gursoy.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
