From 90cb3049e67c573dd479ba9ee5e4f5fe189916c2 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 21 Jun 2013 02:15:12 -0400 Subject: fix refreshing a module first loaded after the first refresh call --- lib/Class/Refresh.pm | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib') diff --git a/lib/Class/Refresh.pm b/lib/Class/Refresh.pm index 24569ab..2cbf0ca 100644 --- a/lib/Class/Refresh.pm +++ b/lib/Class/Refresh.pm @@ -74,6 +74,11 @@ Returns a list of modules which have changed since the last call to C. sub modified_modules { my $class = shift; + if (!%CACHE) { + $class->_update_cache_for($_) for keys %INC; + return; + } + my @ret; for my $file (keys %CACHE) { # refresh files that are in our @@ -89,6 +94,7 @@ sub modified_modules { } else { $class->_update_cache_for($file); + push @ret, $class->_file_to_mod($file); } } -- cgit v1.2.3-54-g00ecf