I think it would be nice to be able to specify the root of where perl_clone
will clone the data structure.
For a thread there is no point in cloning whatever the start sub does not
see (*). Or maybe you just want to clone a certain amount of packages.
For a safe compartment you might want to only want to clone the package the
safe code is allowed to access.
I have had one request for someone who wants an empty thread to start
working off.
I suspect that this is something to do with.
PL_defstash, PL_curstash, PL_nullstash, PL_debstach, PL_globalstash,
PL_curstname, PL_beginav, PL_endav, PL_checkav, PL_initav.
Could it be so simple to duplicate a given package and set it as globalstah?
Btw, why do you we need to duplicate PL_beginav, PL_checkav and PL_initav?
Artur