App-ptimeout
view release on metacpan or search on metacpan
inc/Devel/CheckOS.pm view on Meta::CPAN
die(__PACKAGE__."::list_family_members needs a parameter\n");
# this will die if it's the wrong OS, but the module is loaded ...
eval qq{use Devel::AssertOS::$family};
# ... so we can now query it
my @members = eval qq{
no strict 'refs';
&{"Devel::AssertOS::${family}::matches"}()
};
if(wantarray()) {
return @members;
} else {
warn("Calling list_family_members in scalar context and getting back a reference is deprecated and will go away some time after April 2024. To disable this warning set \$Devel::CheckOS::NoDeprecationWarnings::Context to a true value.\n") unle...
return \@members;
}
}
=head3 register_alias
It takes two arguments, the first being an alias name, the second being the
name of an OS. After the alias has been registered, any queries about the
alias will return the appropriate result for the named OS.
It returns true unless you invoke it incorrectly or you attempt to change
an existing alias.
Aliases don't work under taint-mode.
See L<Devel::AssertOS::Extending>.
=cut
sub register_alias {
my($alias, $os) = @_;
($alias && $os) || return 0;
if(!exists($OS_ALIASES{$alias}) || $OS_ALIASES{$alias} eq $os) {
return $OS_ALIASES{$alias} = $os;
} else {
return 0
}
}
=head1 PLATFORMS SUPPORTED
To see the list of platforms for which information is available, run this:
perl -MDevel::CheckOS -e 'print join(", ", Devel::CheckOS::list_platforms())'
These are the names of the underlying Devel::AssertOS::* modules
which do the actual platform detection, so they have to
be 'legal' filenames and module names, which unfortunately precludes
funny characters, so platforms like OS/2 are mis-spelt deliberately.
Sorry.
Also be aware that not all of them have been properly tested. I don't
have access to most of them and have had to work from information
gleaned from L<perlport> and a few other places. For a complete list of
OS families, see L<Devel::CheckOS::Families>.
If you want to add your own OSes or families, see L<Devel::AssertOS::Extending>
and please feel free to upload the results to the CPAN.
=head1 BUGS and FEEDBACK
I welcome feedback about my code, including constructive criticism.
Bug reports should be made using L<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.
If you are feeling particularly generous you can encourage me in my
open source endeavours by buying me something from my wishlist:
L<http://www.cantrell.org.uk/david/wishlist/>
=head1 COMPATIBILITY
Version 1.90 made all matches case-insensitive. This is a change in behaviour, but
if it breaks your code then your code was already broken, you just didn't know it.
=head1 DEPRECATIONS
At some point after April 2024 the C<list_family_members> and C<list_platforms>
functions will stop being sensitive to whether they are called in list context or
not, and will always return a list. From now until then calling them in non-list
context will emit a warning. You can turn that off by setting
C<$Devel::CheckOS::NoDeprecationWarnings::Context> to a true value.
=head1 SEE ALSO
$^O in L<perlvar>
L<perlport>
L<Devel::AssertOS>
L<Devel::AssertOS::Extending>
L<Probe::Perl>
The use-devel-assertos script
L<Module::Install::AssertOS>
=head1 AUTHOR
David Cantrell E<lt>F<david@cantrell.org.uk>E<gt>
Thanks to David Golden for the name and ideas about the interface, and
to the cpan-testers-discuss mailing list for prompting me to write it
in the first place.
Thanks to Ken Williams, from whose L<Module::Build> I lifted some of the
information about what should be in the Unix family.
Thanks to Billy Abbott for finding some bugs for me on VMS.
Thanks to Matt Kraai for information about QNX.
Thanks to Kenichi Ishigaki and Gabor Szabo for reporting a bug on Windows,
and to the former for providing a patch.
( run in 1.040 second using v1.01-cache-2.11-cpan-b16cb0d3907 )