local $self->{dump_directory} = $self->{temp_directory};
$self->_reload_classes(\@tables);
$self->_load_relationships($_) for @tables;
-# $self->_relbuilder->cleanup; # this breaks perl 5.8.x
+ $self->_relbuilder->cleanup;
$self->{quiet} = 0;
# Remove that temp dir from INC so it doesn't get reloaded
use File::Slurp 'slurp';
use Try::Tiny;
use Class::Unload ();
+use Class::Inspector ();
use List::MoreUtils 'apply';
use namespace::clean;
if (-f (my $existing_remote_file = $self->base->get_dump_filename($remote_class))) {
my $class = "${remote_class}Temporary";
- if (not do { no strict 'refs'; %{$class . '::'} }) {
+ if (not Class::Inspector->loaded($class)) {
my $code = slurp $existing_remote_file;
$code =~ s/(?<=package $remote_class)/Temporary/g;