NAME Check::Fork - Check fork functionality. SYNOPSIS use Check::Fork qw(check_fork $ERROR_MESSAGE); my $ret = check_fork(); print $ERROR_MESSAGE."\n"; DESCRIPTION There is need of check for fork functionality in tests. Actually we have many duplicated and not same check code in distributions. Sic! Intent of this module is create common code for check and test all behaviours. Extra thing is error message which describe issue. SUBROUTINES "check_fork" my $ret = check_fork(); Check possibility of forking functionality on system. Return value is 1 as possible fork() or 0 as not possible fork(). If return value is 0, set $ERROR_MESSAGE variable. Returns 0/1. ERRORS check_fork(): Set $ERROR_MESSAGE variable if $ret is 0: No fork() routine available. $^O: No interpreter-based threading implementation. $^O: No PERL_IMPLICIT_SYS ccflags set. EXAMPLE use strict; use warnings; use Check::Fork qw(check_fork $ERROR_MESSAGE); if (check_fork()) { print "We could fork.\n"; } else { print "We couldn't fork.\n"; print "Error message: $ERROR_MESSAGE\n"; } # Output on Unix with Config{'d_fork'} set: # We could fork. # Output on Unix without Config{'d_fork'} set: # We couldn't fork. # Error message: No fork() routine available. # Output on Windows without $Config{'useithreads'} set: # We couldn't fork. # Error message: MSWin32: No interpreter-based threading implementation. DEPENDENCIES Config, Exporter, Readonly. SEE ALSO Check::Socket Check socket functionality. REPOSITORY AUTHOR Michal Josef Špaček LICENSE AND COPYRIGHT © 2021-2022 Michal Josef Špaček BSD 2-Clause License VERSION 0.01