Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

perl::ostype(3perl) [debian man page]

Perl::OSType(3perl)					 Perl Programmers Reference Guide				       Perl::OSType(3perl)

NAME
Perl::OSType - Map Perl operating system names to generic types VERSION
version 1.002 SYNOPSIS
use Perl::OSType ':all'; $current_type = os_type(); $other_type = os_type('dragonfly'); # gives 'Unix' DESCRIPTION
Modules that provide OS-specific behaviors often need to know if the current operating system matches a more generic type of operating systems. For example, 'linux' is a type of 'Unix' operating system and so is 'freebsd'. This module provides a mapping between an operating system name as given by $^O and a more generic type. The initial version is based on the OS type mappings provided in Module::Build and ExtUtils::CBuilder. (Thus, Microsoft operating systems are given the type 'Windows' rather than 'Win32'.) USAGE
No functions are exported by default. The export tag ":all" will export all functions listed below. os_type() $os_type = os_type(); $os_type = os_type('MSWin32'); Returns a single, generic OS type for a given operating system name. With no arguments, returns the OS type for the current value of $^O. If the operating system is not recognized, the function will return the empty string. is_os_type() $is_windows = is_os_type('Windows'); $is_unix = is_os_type('Unix', 'dragonfly'); Given an OS type and OS name, returns true or false if the OS name is of the given type. As with "os_type", it will use the current operating system as a default if no OS name is provided. SEE ALSO
o Devel::CheckOS AUTHOR
David Golden <dagolden@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by David Golden. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2011-09-19 Perl::OSType(3perl)

Check Out this Related Man Page

Probe::Perl(3)						User Contributed Perl Documentation					    Probe::Perl(3)

NAME
Probe::Perl - Information about the currently running perl VERSION
version 0.03 SYNOPSIS
use Probe::Perl; $p = Probe::Perl->new(); # Version of this perl as a floating point number $ver = $p->perl_version(); $ver = Probe::Perl->perl_version(); # Convert a multi-dotted string to a floating point number $ver = $p->perl_version_to_float($ver); $ver = Probe::Perl->perl_version_to_float($ver); # Check if the given perl is the same as the one currently running $bool = $p->perl_is_same($perl_path); $bool = Probe::Perl->perl_is_same($perl_path); # Find a path to the currently-running perl $path = $p->find_perl_interpreter(); $path = Probe::Perl->find_perl_interpreter(); # Get @INC before run-time additions @paths = $p->perl_inc(); @paths = Probe::Perl->perl_inc(); # Get the general type of operating system $type = $p->os_type(); $type = Probe::Perl->os_type(); # Access Config.pm values $val = $p->config('foo'); $val = Probe::Perl->config('foo'); $p->config('foo' => 'bar'); # Set locally $p->config_revert('foo'); # Revert DESCRIPTION
This module provides methods for obtaining information about the currently running perl interpreter. It originally began life as code in the "Module::Build" project, but has been externalized here for general use. METHODS
new() Creates a new Probe::Perl object and returns it. Most methods in the Probe::Perl packages are available as class methods, so you don't always need to create a new object. But if you want to create a mutable view of the "Config.pm" data, it's necessary to create an object to store the values in. config( $key [, $value] ) Returns the "Config.pm" value associated with $key. If $value is also specified, then the value is set to $value for this view of the data. In this case, "config()" must be called as an object method, not a class method. config_revert( $key ) Removes any user-assigned value in this view of the "Config.pm" data. find_perl_interpreter( ) Returns the absolute path of this perl interpreter. This is actually sort of a tricky thing to discover sometimes - in these cases we use "perl_is_same()" to verify. perl_version( ) Returns the version of this perl interpreter as a perl-styled version number using "perl_version_to_float()". Uses $^V if your perl is recent enough, otherwise uses $]. perl_version_to_float( $version ) Formats $version as a perl-styled version number like 5.008001. perl_is_same( $perl ) Given the name of a perl interpreter, this method determines if it has the same configuration as the one represented by the current perl instance. Usually this means it's exactly the same perl_inc( ) Returns a list of directories in this perl's @INC path, before any entries from "use lib", $ENV{PERL5LIB}, or "-I" switches are added. os_type( [$osname] ) Returns a generic OS type (e.g. "Unix", "Windows", "MacOS") for the given OS name. If no OS name is given it uses the value in $^O, which is the same as $Config{osname}. AUTHOR
Randy W. Sims <randys@thepierianspring.org> Based partly on code from the Module::Build project, by Ken Williams <kwilliams@cpan.org> and others. COPYRIGHT
Copyright 2005 Ken Williams and Randy Sims. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2013-08-07 Probe::Perl(3)
Man Page