in reply to Reloading a module at run time

Do you have any good reason for avoiding using Module::Refresh itself? I don't have any experience with it, but the review on CPAN ratings seems positive, it has good results on CPAN testers, its authors include Jesse Vincent and Audrey Tang (both of whom have good reputations for putting out decent quality code), and it is used in Moose development, so all signs point to it being a good module.

Why steal random chunks from it; why not just use it?

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Replies are listed 'Best First'.
Re^2: Reloading a module at run time
by alpha (Scribe) on Jan 16, 2013 at 09:54 UTC
    Thanks. Using Module::Refresh directly fixed my issue.
    $ cat class.pm package class; use 5.014; use strict; use warnings; use autodie; sub new {bless {}, 'class'} sub talk {print "6111513\n"} 1; $ cat module_refresh_code.pl #!/usr/bin/env perl use strict; use warnings; use autodie; use 5.014; use Data::Dumper; use Module::Refresh; my $refresher = Module::Refresh->new; do './class.pm'; class->new->talk; my $dummy = <>; # we change class.pm meanwhile $refresher->refresh_module('./class.pm'); class->new->talk; $ ./module_refresh_code.pl 6111513 8111513