Created
April 26, 2013 15:07
-
-
Save fgabolde/5467985 to your computer and use it in GitHub Desktop.
Reloading a module at runtime.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use warnings; | |
use 5.010; | |
use Carp; | |
eval 'require Package::Reloaded'; | |
if ($@) { say "exception: $@" } | |
say Package::Reloaded::blah(); | |
my $wait = <STDIN>; # edit Package/Reloaded.pm before pressing RET | |
# use Module::Runtime::module_notional_filename here, instead of hardcoding the module filename | |
delete $INC{'Package/Reloaded.pm'}; | |
eval 'require Package::Reloaded'; | |
if ($@) { say "exception when reloading: $@" } | |
say Package::Reloaded::blah(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment