Unix and Linux Discussions Tagged with linux mandrake |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
192 |
262,414 |
Open Source |
|
|
|
182 |
210,976 |
SuSE |
|
|
|
4 |
8,954 |
Filesystems, Disks and Memory |
|
|
|
8 |
19,979 |
Cybersecurity |
|
|
|
5 |
5,608 |
Red Hat |
|
|
|
2 |
5,063 |
Linux |
|
|
|
14 |
20,458 |
UNIX Desktop Questions & Answers |
|
|
|
7 |
23,578 |
UNIX for Dummies Questions & Answers |
|
|
|
10 |
9,091 |
UNIX for Advanced & Expert Users |
|
|
|
4 |
5,039 |
Filesystems, Disks and Memory |
|
|
|
6 |
4,489 |
UNIX for Dummies Questions & Answers |
|
|
|
11 |
5,968 |
Programming |
|
|
|
2 |
2,461 |
UNIX for Dummies Questions & Answers |
|
|
|
37 |
20,417 |
What is on Your Mind? |
|
|
|
2 |
2,396 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,812 |
Linux |
|
|
|
1 |
6,561 |
Cybersecurity |
|
|
|
15 |
41,266 |
Red Hat |
|
|
|
6 |
3,313 |
UNIX for Dummies Questions & Answers |
|
|
|
14 |
21,728 |
Red Hat |
|
|
|
6 |
27,675 |
IP Networking |
|
|
|
3 |
3,520 |
UNIX for Dummies Questions & Answers |
|
|
|
13 |
8,274 |
Solaris |
|
|
|
1 |
14,846 |
Linux |
|
|
|
1 |
2,702 |
UNIX for Dummies Questions & Answers |
|
|
|
13 |
7,138 |
Linux |
|
|
|
8 |
9,985 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
3,839 |
UNIX for Dummies Questions & Answers |
|
|
|
3 |
2,477 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,194 |
Linux |
|
|
|
7 |
128,394 |
Slackware |
|
|
|
9 |
11,632 |
HP-UX |
|
|
|
3 |
7,914 |
Linux |
|
|
|
1 |
2,658 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
28,359 |
UNIX for Advanced & Expert Users |
|
|
|
2 |
6,629 |
Programming |
|
|
|
2 |
3,927 |
Linux |
|
|
|
11 |
5,439 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
3,880 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
3,350 |
Linux |
Linux::Distribution(3pm) User Contributed Perl Documentation Linux::Distribution(3pm)
NAME
Linux::Distribution - Perl extension to detect on which Linux distribution we are running.
SYNOPSIS
use Linux::Distribution qw(distribution_name distribution_version);
if(my $distro = distribution_name) {
my $version = distribution_version();
print "you are running $distro, version $version
";
} else {
print "distribution unknown
";
}
Or else do it OO:
use Linux::Distribution qw(distribution_name distribution_version);
my $linux = Linux::Distribution->new;
if(my $distro = $linux->distribution_name()) {
my $version = $linux->distribution_version();
print "you are running $distro, version $version
";
} else {
print "distribution unknown
";
}
DESCRIPTION
This is a simple module that tries to guess on what linux distribution we are running by looking for release's files in /etc. It now looks
for 'lsb-release' first as that should be the most correct and adds ubuntu support. Secondly, it will look for the distro specific files.
It currently recognizes slackware, debian, suse, fedora, redhat, turbolinux, yellowdog, knoppix, mandrake, conectiva, immunix, tinysofa,
va-linux, trustix, adamantix, yoper, arch-linux, libranet, gentoo, ubuntu, scientific, oracle enterprise linux and redflag.
It has function to get the version for debian, suse, fedora, redhat, gentoo, slackware, scientific, oracle enterprise linux, redflag and
ubuntu(lsb). People running unsupported distro's are greatly encouraged to submit patches :-)
EXPORT
None by default.
TODO
Add the capability of recognize the version of the distribution for all recognized distributions.
AUTHORS
Alexandr Ciornii <alexchorny@gmail.com>, <http://chorny.net> Alberto Re, <alberto@accidia.net> Judith Lebzelter, <judith@osdl.org>
COPYRIGHT AND LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or,
at your option, any later version of Perl 5 you may have available.
perl v5.14.2 2012-03-18 Linux::Distribution(3pm)