NAME

Sub::Fork - Running subroutines in forked process

SYNOPSIS

use Sub::Fork qw( fork );
$Sub::Fork::IPC_Shareable_size = 100000000;

my $result = fork {
    my $a = 2 + 2 + 2 + 2;
    return $a;
};
      
print 'result=' . $result . "\n";

DESCRIPTION

This module provides simple interface for running subroutines in separated forked process. Result returned via IPC::Shareable interface. You may specify the size of the shared memory segment allocated by $Sub::Fork::IPC_Shareable_size

FUNCTIONS

The module provides the following functions:

fork

my $result = fork { 2 + 2 };

TROUBLESHOOTING

Length of shared data exceeds shared segment size

Try to increase $Sub::Fork::IPC_Shareable_size value.

SEE ALSO

IPC::Shareable used for subroutines result return to parent process.

AUTHOR

Ivan Trunaev, <itrunaev@cpan.org>

COPYRIGHT AND LICENSE

Copyright 2010 Ivan Trunaev <itrunaev@cpan.org>

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. That means either (a) the GNU General Public License or (b) the Artistic License.