1Module::Refresh(3)    User Contributed Perl Documentation   Module::Refresh(3)
2
3
4

NAME

6       Module::Refresh - Refresh %INC files when updated on disk
7

SYNOPSIS

9           # During each request, call this once to refresh changed modules:
10
11           Module::Refresh->refresh;
12
13           # Each night at midnight, you automatically download the latest
14           # Acme::Current from CPAN.  Use this snippet to make your running
15           # program pick it up off disk:
16
17           $refresher->refresh_module('Acme/Current.pm');
18

DESCRIPTION

20       This module is a generalization of the functionality provided by
21       Apache::StatINC and Apache::Reload.  It's designed to make it easy to
22       do simple iterative development when working in a persistent environ‐
23       ment.
24
25       It does not require mod_perl.
26
27       new
28
29       Initialize the module refresher.
30
31       refresh
32
33       Refresh all modules that have mtimes on disk newer than the newest ones
34       we've got.  Calls "new" to initialize the cache if it had not yet been
35       called.
36
37       Specifically, it will renew any module that was loaded before the pre‐
38       vious call to "refresh" (or "new") and has changed on disk since then.
39       If a module was both loaded for the first time and changed on disk
40       between the previous call and this one, it will not be reloaded by this
41       call (or any future one); you will need to update the modification time
42       again (by using the Unix "touch" command or making a change to it) in
43       order for it to be reloaded.
44
45       refresh_module_if_modified $module
46
47       If $module has been modified on disk, refresh it. Otherwise, do nothing
48
49       refresh_module $module
50
51       Refresh a module.  It doesn't matter if it's already up to date.  Just
52       do it.
53
54       Note that it only accepts module names like "Foo/Bar.pm", not
55       "Foo::Bar".
56
57       unload_module $module
58
59       Remove a module from %INC, and remove all subroutines defined in it.
60
61       mtime $file
62
63       Get the last modified time of $file in seconds since the epoch;
64
65       update_cache $file
66
67       Updates the cached "last modified" time for $file.
68
69       unload_subs $file
70
71       Wipe out subs defined in $file.
72

BUGS

74       When we walk the symbol table to whack reloaded subroutines, we don't
75       have a good way to invalidate the symbol table.
76

SEE ALSO

78       Apache::StatINC, Module::Reload
79
81       Copyright 2004 by Jesse Vincent <jesse@bestpractical.com>, Autrijus
82       Tang <autrijus@autrijus.org>
83
84       This program is free software; you can redistribute it and/or modify it
85       under the same terms as Perl itself.
86
87       See <http://www.perl.com/perl/misc/Artistic.html>
88
89
90
91perl v5.8.8                       2007-05-03                Module::Refresh(3)
Impressum