# perldoc > Perl::OSType

---
type: CommandReference
command: Perl::OSType
mode: perldoc
section: ""
source: perldoc
---

## Quick Reference

- `use Perl::OSType ':all';` — import all functions
- `$type = os_type();` — get current OS type
- `$type = os_type('MSWin32');` — get type for a specific OS name
- `$is_windows = is_os_type('Windows');` — check if current OS is Windows
- `$is_unix = is_os_type('Unix', 'dragonfly');` — check if a given OS name is of a type

## Name

Map Perl operating system names to generic types

## Synopsis

perl
use Perl::OSType ':all';

$current_type = os_type();
$other_type = os_type('dragonfly'); # gives 'Unix'
## Functions

- `os_type()` — returns a single generic OS type for a given OS name. With no arguments, returns the OS type for the current value of `$^O`. If the OS is not recognized, returns the empty string.
- `is_os_type($type, $os_name)` — given an OS type and OS name, returns true if the OS name is of the given type. Uses the current OS as default if no OS name is provided.

## Examples

perl
use Perl::OSType ':all';

# Get current OS type
my $type = os_type();

# Check if a specific OS is Unix
my $is_unix = is_os_type('Unix', 'freebsd');  # true

# Check if current OS is Windows
my $is_windows = is_os_type('Windows');

# Get type for MSWin32
my $win_type = os_type('MSWin32');  # 'Windows'
## See Also

- [Devel::CheckOS](http://localhost/phpMan.php/perldoc/Devel%3A%3ACheckOS/markdown)