use strict; use Safe; my $CODE = << 'END'; package A; sub new { my($class) = @_; print "hi there"; bless { }, $class; } package B; @ISA = qw(ROOT::A); END # If I uncomment this line, everything works. # eval $CODE; my $safe = Safe->new('ROOT'); $safe->reval($CODE); warn "code - $@" if $@; ROOT::B->new(); warn "new - $@" if $@;