README
1NAME
2 Perl::OSType - Map Perl operating system names to generic types
3
4VERSION
5 version 1.010
6
7SYNOPSIS
8 use Perl::OSType ':all';
9
10 $current_type = os_type();
11 $other_type = os_type('dragonfly'); # gives 'Unix'
12
13DESCRIPTION
14 Modules that provide OS-specific behaviors often need to know if the
15 current operating system matches a more generic type of operating
16 systems. For example, 'linux' is a type of 'Unix' operating system and
17 so is 'freebsd'.
18
19 This module provides a mapping between an operating system name as given
20 by $^O and a more generic type. The initial version is based on the OS
21 type mappings provided in Module::Build and ExtUtils::CBuilder. (Thus,
22 Microsoft operating systems are given the type 'Windows' rather than
23 'Win32'.)
24
25USAGE
26 No functions are exported by default. The export tag ":all" will export
27 all functions listed below.
28
29 os_type()
30 $os_type = os_type();
31 $os_type = os_type('MSWin32');
32
33 Returns a single, generic OS type for a given operating system name.
34 With no arguments, returns the OS type for the current value of $^O. If
35 the operating system is not recognized, the function will return the
36 empty string.
37
38 is_os_type()
39 $is_windows = is_os_type('Windows');
40 $is_unix = is_os_type('Unix', 'dragonfly');
41
42 Given an OS type and OS name, returns true or false if the OS name is of
43 the given type. As with "os_type", it will use the current operating
44 system as a default if no OS name is provided.
45
46SEE ALSO
47 * Devel::CheckOS
48
49SUPPORT
50 Bugs / Feature Requests
51 Please report any bugs or feature requests through the issue tracker at
52 <https://github.com/Perl-Toolchain-Gang/Perl-OSType/issues>. You will be
53 notified automatically of any progress on your issue.
54
55 Source Code
56 This is open source software. The code repository is available for
57 public review and contribution under the terms of the license.
58
59 <https://github.com/Perl-Toolchain-Gang/Perl-OSType>
60
61 git clone https://github.com/Perl-Toolchain-Gang/Perl-OSType.git
62
63AUTHOR
64 David Golden <dagolden@cpan.org>
65
66CONTRIBUTORS
67 * Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
68
69 * David Golden <xdg@xdg.me>
70
71 * Graham Ollis <plicease@cpan.org>
72
73 * Jonas B. Nielsen <jonasbn@hoarfrost.local>
74
75 * Owain G. Ainsworth <oga@nicotinebsd.org>
76
77 * Paul Green <Paul.Green@stratus.com>
78
79 * Piotr Roszatycki <piotr.roszatycki@gmail.com>
80
81COPYRIGHT AND LICENSE
82 This software is copyright (c) 2016 by David Golden.
83
84 This is free software; you can redistribute it and/or modify it under
85 the same terms as the Perl 5 programming language system itself.
86
87