… | |
… | |
158 | |
158 | |
159 | sub load_extensions { |
159 | sub load_extensions { |
160 | my $LIBDIR = maps_directory "perl"; |
160 | my $LIBDIR = maps_directory "perl"; |
161 | |
161 | |
162 | for my $ext (<$LIBDIR/*.ext>) { |
162 | for my $ext (<$LIBDIR/*.ext>) { |
|
|
163 | next unless -r $ext; |
163 | eval { |
164 | eval { |
164 | load_extension $ext; |
165 | load_extension $ext; |
165 | 1 |
166 | 1 |
166 | } or warn "$ext not loaded: $@"; |
167 | } or warn "$ext not loaded: $@"; |
167 | } |
168 | } |
… | |
… | |
169 | |
170 | |
170 | register_command "perl-reload", 0, sub { |
171 | register_command "perl-reload", 0, sub { |
171 | my ($who, $arg) = @_; |
172 | my ($who, $arg) = @_; |
172 | |
173 | |
173 | if ($who->flag (FLAG_WIZ)) { |
174 | if ($who->flag (FLAG_WIZ)) { |
|
|
175 | $who->message ("reloading..."); |
|
|
176 | |
174 | warn "reloading...\n"; |
177 | warn "reloading...\n"; |
175 | unload_extension $_ for @exts; |
178 | unload_extension $_ for @exts; |
176 | @exts = 0; |
179 | @exts = 0; |
177 | load_extensions; |
180 | load_extensions; |
178 | warn "reloaded\n"; |
181 | warn "reloaded\n"; |
|
|
182 | |
|
|
183 | $who->message ("reloaded"); |
|
|
184 | } else { |
|
|
185 | $who->message ("Intruder Alert!"); |
179 | } |
186 | } |
180 | }; |
187 | }; |
181 | |
188 | |
182 | load_extensions; |
189 | load_extensions; |
183 | |
190 | |