Module1
Use threads;
Use threads::shared;
Use Module 2;
sub thread_it
{
Code that uses threads/threads::shared
}
sub fork_it
{
my $mod2 = Module2->new()
$mod->fork_it()
}
####
Module2
Use forks;
Use forks::shared;
sub fork_it
{
code that runs forks here
}
####
my $mod1 = Module1->new()
$mod1->fork_it()
$mod1->thread_it()