… | |
… | |
1281 | } |
1281 | } |
1282 | |
1282 | |
1283 | ############################################################################# |
1283 | ############################################################################# |
1284 | # initialisation |
1284 | # initialisation |
1285 | |
1285 | |
1286 | sub _perl_reload() { |
1286 | sub perl_reload() { |
1287 | # can/must only be called in main |
1287 | # can/must only be called in main |
1288 | if ($Coro::current != $Coro::main) { |
1288 | if ($Coro::current != $Coro::main) { |
1289 | warn "can only reload from main coroutine\n"; |
1289 | warn "can only reload from main coroutine\n"; |
1290 | return; |
1290 | return; |
1291 | } |
1291 | } |
… | |
… | |
1373 | } |
1373 | } |
1374 | |
1374 | |
1375 | warn "reloaded successfully"; |
1375 | warn "reloaded successfully"; |
1376 | }; |
1376 | }; |
1377 | |
1377 | |
1378 | sub perl_reload() { |
|
|
1379 | _perl_reload; |
|
|
1380 | } |
|
|
1381 | |
|
|
1382 | register "<global>", __PACKAGE__; |
1378 | register "<global>", __PACKAGE__; |
1383 | |
1379 | |
1384 | register_command "perl-reload" => sub { |
1380 | register_command "perl-reload" => sub { |
1385 | my ($who, $arg) = @_; |
1381 | my ($who, $arg) = @_; |
1386 | |
1382 | |
1387 | if ($who->flag (FLAG_WIZ)) { |
1383 | if ($who->flag (FLAG_WIZ)) { |
1388 | $who->message ("reloading..."); |
1384 | $who->message ("start of reload."); |
1389 | _perl_reload; |
1385 | perl_reload; |
|
|
1386 | $who->message ("end of reload."); |
1390 | } |
1387 | } |
1391 | }; |
1388 | }; |
1392 | |
1389 | |
1393 | unshift @INC, $LIBDIR; |
1390 | unshift @INC, $LIBDIR; |
1394 | |
1391 | |