Devel::AssertOS(3)

πŸ“¦
version 2.40.0 Β· 3 versions
, in opensuse-leap 16.0

πŸ’… Devel::AssertOS(3) β€” like, the manual page, bestie

okay so this is the Devel::AssertOS(3) page from the User Contributed Perl Documentation section, and honestly? it's a little baddie. let's get into it πŸŽ€


✨ NAME ✨

Devel::AssertOS β€” require that we are running on a particular OS 🌸


πŸ¦‹ DESCRIPTION πŸ¦‹

Devel::AssertOS is a utility module for Devel::CheckOS and Devel::AssertOS::*. and when I say utility I mean it is nothing but a magic import(). that's it. that's the whole girl. no cap. πŸ’…

and what does that magic import() let you do? this:

use Devel::AssertOS qw(Linux FreeBSD Cygwin);

which will die 😭 unless the platform the code is running on is Linux, FreeBSD or Cygwin. dramatic? yes. correct? also yes. πŸ”₯

now, say you wanna assert the opposite β€” that the OS is not a specific platform. you just prepend the platform name with a minus sign -. iconic little trick honestly. for example, to run on anything but Amiga, do:

use Devel::AssertOS qw(-Amiga);

that's it. go off. ✨


πŸ› BUGS and FEEDBACK πŸ›

I welcome feedback about my code, including constructive criticism 🫢 (yes really, be nice but be honest).

Bug reports should be made using <https://github.com/DrHyde/perl-modules-Devel-CheckOS/issues> πŸ“¬

You will need to include in your bug report the exact value of $^O, what the OS is called (eg Windows Vista 64 bit Ultimate Home Edition), and, if relevant, what "OS family" it should be in and who wrote it. give me all the lore, bestie πŸ™ˆ

and if you are feeling particularly generous you can encourage me in my open source endeavours by buying me something from my wishlist: <http://www.cantrell.org.uk/david/wishlist/> 🎁

πŸ‘€ SEE ALSO πŸ‘€

  • $^O in perlvar
  • perlport
  • Devel::CheckOS
  • Devel::AssertOS::Extending
  • The use-devel-assertos script
  • Module::Install::AssertOS

iykyk πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

David Cantrell <david@cantrell.org.uk>

Thanks to David Golden for suggesting that I add this utility module. absolute king behaviour, we love to see it 🫑✨


Copyright 2024 David Cantrell

This software is free-as-in-speech software, and may be used, distributed, and modified under the terms of either the GNU General Public Licence version 2 or the Artistic Licence. It's up to you which one you use. The full text of the licences can be found in the files GPL2.txt and ARTISTIC.txt, respectively. read the fine print, bestie, it's giving responsible πŸ“œ


🧚 CONSPIRACY 🧚

This module is also free-as-in-mason software.

like, don't ask. it's a vibe. πŸ§±πŸ’€

and that's the whole page, fr fr β€” this was Devel::AssertOS(3) from perl v5.42.0, dated 2024-06-23. slay, go assert some OSes responsibly πŸŒˆβ­πŸ’–

πŸ“¦ where this page comes from