| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "Perl::OSType 3perl" |
| 58 |
.TH Perl::OSType 3perl 2025-11-16 "perl v5.40.1" "Perl Programmers Reference Guide" |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
Perl::OSType \- Map Perl operating system names to generic types |
| 65 |
.SH VERSION |
| 66 |
.IX Header "VERSION" |
| 67 |
version 1.010 |
| 68 |
.SH SYNOPSIS |
| 69 |
.IX Header "SYNOPSIS" |
| 70 |
.Vb 1 |
| 71 |
\& use Perl::OSType \*(Aq:all\*(Aq; |
| 72 |
\& |
| 73 |
\& $current_type = os_type(); |
| 74 |
\& $other_type = os_type(\*(Aqdragonfly\*(Aq); # gives \*(AqUnix\*(Aq |
| 75 |
.Ve |
| 76 |
.SH DESCRIPTION |
| 77 |
.IX Header "DESCRIPTION" |
| 78 |
Modules that provide OS-specific behaviors often need to know if |
| 79 |
the current operating system matches a more generic type of |
| 80 |
operating systems. For example, 'linux' is a type of 'Unix' operating system |
| 81 |
and so is 'freebsd'. |
| 82 |
.PP |
| 83 |
This module provides a mapping between an operating system name as given by |
| 84 |
\&\f(CW$^O\fR and a more generic type. The initial version is based on the OS type |
| 85 |
mappings provided in Module::Build and ExtUtils::CBuilder. (Thus, |
| 86 |
Microsoft operating systems are given the type 'Windows' rather than 'Win32'.) |
| 87 |
.SH USAGE |
| 88 |
.IX Header "USAGE" |
| 89 |
No functions are exported by default. The export tag ":all" will export |
| 90 |
all functions listed below. |
| 91 |
.SS \fBos_type()\fP |
| 92 |
.IX Subsection "os_type()" |
| 93 |
.Vb 2 |
| 94 |
\& $os_type = os_type(); |
| 95 |
\& $os_type = os_type(\*(AqMSWin32\*(Aq); |
| 96 |
.Ve |
| 97 |
.PP |
| 98 |
Returns a single, generic OS type for a given operating system name. With no |
| 99 |
arguments, returns the OS type for the current value of \f(CW$^O\fR. If the |
| 100 |
operating system is not recognized, the function will return the empty string. |
| 101 |
.SS \fBis_os_type()\fP |
| 102 |
.IX Subsection "is_os_type()" |
| 103 |
.Vb 2 |
| 104 |
\& $is_windows = is_os_type(\*(AqWindows\*(Aq); |
| 105 |
\& $is_unix = is_os_type(\*(AqUnix\*(Aq, \*(Aqdragonfly\*(Aq); |
| 106 |
.Ve |
| 107 |
.PP |
| 108 |
Given an OS type and OS name, returns true or false if the OS name is of the |
| 109 |
given type. As with \f(CW\*(C`os_type\*(C'\fR, it will use the current operating system as a |
| 110 |
default if no OS name is provided. |
| 111 |
.SH "SEE ALSO" |
| 112 |
.IX Header "SEE ALSO" |
| 113 |
.IP \(bu 4 |
| 114 |
Devel::CheckOS |
| 115 |
.SH SUPPORT |
| 116 |
.IX Header "SUPPORT" |
| 117 |
.SS "Bugs / Feature Requests" |
| 118 |
.IX Subsection "Bugs / Feature Requests" |
| 119 |
Please report any bugs or feature requests through the issue tracker |
| 120 |
at <https://github.com/Perl\-Toolchain\-Gang/Perl\-OSType/issues>. |
| 121 |
You will be notified automatically of any progress on your issue. |
| 122 |
.SS "Source Code" |
| 123 |
.IX Subsection "Source Code" |
| 124 |
This is open source software. The code repository is available for |
| 125 |
public review and contribution under the terms of the license. |
| 126 |
.PP |
| 127 |
<https://github.com/Perl\-Toolchain\-Gang/Perl\-OSType> |
| 128 |
.PP |
| 129 |
.Vb 1 |
| 130 |
\& git clone https://github.com/Perl\-Toolchain\-Gang/Perl\-OSType.git |
| 131 |
.Ve |
| 132 |
.SH AUTHOR |
| 133 |
.IX Header "AUTHOR" |
| 134 |
David Golden <[email protected]> |
| 135 |
.SH CONTRIBUTORS |
| 136 |
.IX Header "CONTRIBUTORS" |
| 137 |
.IP \(bu 4 |
| 138 |
Chris 'BinGOs' Williams <[email protected]> |
| 139 |
.IP \(bu 4 |
| 140 |
David Golden <[email protected]> |
| 141 |
.IP \(bu 4 |
| 142 |
Graham Ollis <[email protected]> |
| 143 |
.IP \(bu 4 |
| 144 |
Jonas B. Nielsen <[email protected]> |
| 145 |
.IP \(bu 4 |
| 146 |
Owain G. Ainsworth <[email protected]> |
| 147 |
.IP \(bu 4 |
| 148 |
Paul Green <[email protected]> |
| 149 |
.IP \(bu 4 |
| 150 |
Piotr Roszatycki <[email protected]> |
| 151 |
.SH "COPYRIGHT AND LICENSE" |
| 152 |
.IX Header "COPYRIGHT AND LICENSE" |
| 153 |
This software is copyright (c) 2016 by David Golden. |
| 154 |
.PP |
| 155 |
This is free software; you can redistribute it and/or modify it under |
| 156 |
the same terms as the Perl 5 programming language system itself. |