DynaLoader::dl_unload_file() is only called automatically to unload all
loaded shared objects if the perl interpreter was built with the C macro
DL_UNLOAD_ALL_AT_EXIT defined. The documentation has been incorrectly
stating that it is always called since dl_unload_file() was added in v5.6.0
When dl_unload_file() was first added by commit
abb9e9dca5a5f121 (March 1st,
2000), it was always called at exit, if available. It was made conditional on
DL_UNLOAD_ALL_AT_EXIT being defined by commit
23d2500b2b45b1be (March 20th,
2000), but the documentation was never updated to reflect this. v5.6.0 was
release on March 22nd, 2000.
# Tim.Bunce@ig.co.uk, August 1994
BEGIN {
- $VERSION = '1.19';
+ $VERSION = '1.20';
}
use Config;
Dynamically unload $libref, which must be an opaque 'library reference' as
returned from dl_load_file. Returns one on success and zero on failure.
-
This function is optional and may not necessarily be provided on all platforms.
-If it is defined, it is called automatically when the interpreter exits for
+
+If it is defined and perl is compiled with the C macro C<DL_UNLOAD_ALL_AT_EXIT>
+defined, then it is called automatically when the interpreter exits for
every shared object or library loaded by DynaLoader::bootstrap. All such
library references are stored in @dl_librefs by DynaLoader::Bootstrap as it
loads the libraries. The files are unloaded in last-in, first-out order.