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

# [NAME](#NAME)

Perl::OSType - Map Perl operating system names to generic types

# [VERSION](#VERSION)

version 1.010

# [SYNOPSIS](#SYNOPSIS)

```
  use Perl::OSType ':all';
  $current_type = os_type();
  $other_type = os_type('dragonfly'); # gives 'Unix'
```

# [DESCRIPTION](#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](#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](#SEE_ALSO)

•

Devel::CheckOS

# [SUPPORT](#SUPPORT)

## [Bugs / Feature Requests](#Bugs_/_Feature_Requests)

Please report any bugs or feature requests through the issue tracker at &lt;https://github.com/Perl-Toolchain-Gang/Perl-OSType/issues&gt;. You will be notified automatically of any progress on your issue.

## [Source Code](#Source_Code)

This is open source software. The code repository is available for public review and contribution under the terms of the license.

&lt;https://github.com/Perl-Toolchain-Gang/Perl-OSType&gt;

```
  git clone https://github.com/Perl-Toolchain-Gang/Perl-OSType.git
```

# [AUTHOR](#AUTHOR)

David Golden &lt;dagolden@cpan.org&gt;

# [CONTRIBUTORS](#CONTRIBUTORS)

- Chris 'BinGOs' Williams &lt;chris@bingosnet.co.uk&gt;
- David Golden &lt;xdg@xdg.me&gt;
- Graham Ollis &lt;plicease@cpan.org&gt;
- Jonas B. Nielsen &lt;jonasbn@hoarfrost.local&gt;
- Owain G. Ainsworth &lt;oga@nicotinebsd.org&gt;
- Paul Green &lt;Paul.Green@stratus.com&gt;
- Piotr Roszatycki &lt;piotr.roszatycki@gmail.com&gt;

# [COPYRIGHT AND LICENSE](#COPYRIGHT_AND_LICENSE)

This software is copyright (c) 2016 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.

2026-10-21 perl v5.44.0

---

Document: Perl::OSType(3pm) from perl 5.44.0-r2 (Chainguard OS)
Source: https://github.com/Perl/perl5.git
