in reply to Re: Unloading a module completely
in thread Unloading a module completely

Note that you need to make a close() after run your code, or you won't have the output flushed! Or you can just use flush in the creation.

Soo, your code should be:

use Safe::World; my ($stdout, $stderr); my $world = Safe::World->new( stdout => \$stdout, stderr => \$stderr, ); $world->eval('print 12 ** 2, "\n";'); $world->close ; print $stdout ;
Or using flush:
use Safe::World; my ($stdout, $stderr); my $world = Safe::World->new( stdout => \$stdout, stderr => \$stderr, flush => 1 , ); $world->eval('print 12 ** 2, "\n";'); print $stdout ;

Graciliano M. P.
"Creativity is the expression of the liberty".