Perl::OSType(3perl)
π Perl::OSType π
okay bestie so this is the Perl::OSType page from the Perl Programmers Reference Guide, and it's literally the little module that goes "yes queen, your $^O is giving Unix" π
β¨ VERSION β¨
version 1.010 β fresh, iconic, no notes.
πΈ SYNOPSIS πΈ
use Perl::OSType ':all';
$current_type = os_type();
$other_type = os_type('dragonfly'); # gives 'Unix'
that's it. that's the whole vibe. two functions and a dream π¦
π DESCRIPTION π
so like, modules that do OS-specific stuff always need to know whether the current operating system matches some bigger, more generic type of operating system, yk? classic example: 'linux' is a type of 'Unix' operating system, and so is 'freebsd'. like they're cousins, they're in the same group chat.
this module hands you 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. and because of that, heads up: Microsoft operating systems are given the type 'Windows' rather than 'Win32'. that's just the lore π
π USAGE π
No functions are exported by default. (shy module energy, respect.) But the export tag ":all" will export all functions listed below. slay.
π§ 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, it returns the OS type for the current value of $^O. And if the operating system is not recognized? the function will return the empty string. it's giving "idk her" π
π 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. so if you're lazy (same) it just checks this machine β¨
π₯ SEE ALSO π₯
Devel::CheckOSβ the other girl in the friend group
π«Ά 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. yes bestie, you get notifications. we keep you posted fr fr π¬
π» 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
come contribute, the door is open, the playlist is on π§
β AUTHOR β
David Golden <dagolden@cpan.org> β the main character π
π CONTRIBUTORS π
- Chris 'BinGOs' Williams <chris@bingosnet.co.uk>
- David Golden <xdg@xdg.me>
- Graham Ollis <plicease@cpan.org>
- Jonas B. Nielsen <jonasbn@hoarfrost.local>
- Owain G. Ainsworth <oga@nicotinebsd.org>
- Paul Green <Paul.Green@stratus.com>
- Piotr Roszatycki <piotr.roszatycki@gmail.com>
the whole squad ate, no crumbs left π
π 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. periodt. π
and that's the whole page bestie!! this was Perl::OSType(3perl) from perl v5.44.0, dated 2026-10-17. go forth and os_type() responsibly π¦β¨π
π¦ where this page comes from
- arch rolling: perl 5.44.0-1 Β· Artistic-1.0-Perl AND GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms