in reply to Re: pp: modules disappearing while program runs?
in thread pp: modules disappearing while program runs?
./lib/Blah/Blah.pm:
package Blah::Blah; use 5.012; # strict, // use warnings; $| = 1; print "Loading Blah::Blah at " . scalar(localtime) . "\n"; 1;
./example.pl:
#!perl use 5.012; # strict, // use warnings; use lib './lib'; $| = 1; require Blah::Blah; print "example separator\n"; delete $INC{'Blah/Blah.pm'}; print "entry deleted\n"; sleep(2); require Blah::Blah; print "example separator\n";
output:
Loading Blah::Blah at Thu Apr 7 06:17:19 2022 example separator entry deleted Loading Blah::Blah at Thu Apr 7 06:17:21 2022 example separator
Edit: add footnote: *: well, at the command line; I admit I didn't try in a pp executable
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: pp: modules disappearing while program runs?
by choroba (Cardinal) on Apr 07, 2022 at 13:29 UTC |