The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Linux::Info::Distribution - base class to handle Linux distribution information

VERSION

version 2.11

SYNOPSIS

    # just an example, you probably want to use
    # Linux::Info::DistributionFactory instead
    my $distro = Linux::Info::Distribution-new({
        name => 'Foobar',
        version_id => '1.0',
        version => '1.0 (Cool Name)',
        id => 'foobar'
    });

DESCRIPTION

This is a base class that defines the most basic information one could retrieve from a Linux distribution.

You probably want to the take a look of subclasses of this classes, unless you looking for creating a entirely new classes tree.

Also, you probably want to use a factory class to create new instances instead doing it manually.

The Linux::Info::Distribution namespace started as a fork from Linux::Distribution distribution, even with some code shared between both of them, although the API is very different.

At the end, modules under the Linux::Info::Distribution tries to rely more in the /etc/os-release file, which is more standardized and includes more information.

METHODS

new

Creates and returns new instance.

Expects a hash reference with the following keys:

  • name: the distribution name

  • id: a more concise, short version of the distribution name, normally in all lowercase.

  • version: the long version identification of the distribution.

  • version_id: a shorter version of version, generally with only numbers and dots, possible a semantic version number.

get_name

A getter for the name attribute.

get_id

A getter for the id attribute.

get_version

A getter for the version attribute.

get_version_id

A getter for the version_id attribute.

EXPORTS

Nothing.

SEE ALSO

AUTHOR

Alceu Rodrigues de Freitas Junior <glasswalk3r@yahoo.com.br>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2015 by Alceu Rodrigues de Freitas Junior.

This is free software, licensed under:

  The GNU General Public License, Version 3, June 2007