perldoc > Perl::OSType

đŸˇī¸ NAME

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

🚀 Quick Reference

Use CaseCommandDescription
Get current OS typeos_type()Returns generic type (e.g., 'Unix', 'Windows') for current OS
Check if current OS is Unix-likeis_os_type('Unix')Returns true if current OS is a Unix variant
Check if a specific OS is of a typeis_os_type('Unix', 'dragonfly')Returns true if given OS name belongs to the specified type

đŸ“Ļ VERSION

version 1.010

📋 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

🆘 SUPPORT

🐛 Bugs / Feature Requests

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

📂 Source Code

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

https://github.com/Perl-Toolchain-Gang/Perl-OSType

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

âœī¸ AUTHOR

David Golden <dagolden AT cpan.org>

🙌 CONTRIBUTORS

ÂŠī¸ 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.

Perl::OSType
đŸˇī¸ NAME 🚀 Quick Reference đŸ“Ļ VERSION 📋 SYNOPSIS 📖 DESCRIPTION đŸ› ī¸ USAGE
🔧 os_type() 🔧 is_os_type()
đŸ‘ī¸ SEE ALSO 🆘 SUPPORT
🐛 Bugs / Feature Requests 📂 Source Code
âœī¸ AUTHOR 🙌 CONTRIBUTORS ÂŠī¸ COPYRIGHT AND LICENSE

Generated by phpman v4.9.26-5-g7740029 · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-08-21 21:13 @216.73.217.134
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!

^_top_^