autodynaload - Dynamically locate shared objects on your system
use autodynaload sub { my ($this, $f) = @_ ; if ($f eq 'some_object'){ return "/path/to/some_object.so" ; } return undef ; } ;
autodynaload allows you to specify the location of a shared object at runtime. It does so by overriding the proper DynaLoader methods and allowing for handlers to be registered.
autodynaload
The subroutine argument can be either a coderef or scalar value, in which case it will be used as a symbolic reference. Note: no error will be generated if the symbolic reference does not resolve. This allows a handler to "kick in" at later time when the subroutine in question is actually defined.
The subroutine must return the absolute path to the shared object. A return value of undef will pass control to the next handler (either a previous autodynaload handler or DynaLoader's default mechanism).
Creates a new autodynaload object that will call HANDLER when invoked. For it to be of any use you must place the object in the proper array (in this case the @autodynaload::INC array) using the insert method.
Note: autodynaload extends autorequire. See autorequire for methods not documented here.
See "insert" in autorequire. In this case the array will be @autodynaload::INC.
See "delete" in autorequire. In this case the array will be @autodynaload::INC.
Convenience method that returns the absolute path of FILENAME if the shared object FILENAME is found in the @DynaLoader::dl_shared_objects array. Returns undef is the shared object is not loaded.
Convenience method that returns the absolute path of FILENAME if the shared object FILENAME is installed on the system. It does this using the ExtUtils::Installed module. Please that this method is somewhat slow.
DynaLoader, autorequire.
Patrick LeBoutillier, <patl@cpan.org>
Copyright (C) 2005 by Patrick LeBoutillier
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.
To install autorequire, copy and paste the appropriate command in to your terminal.
cpanm
cpanm autorequire
CPAN shell
perl -MCPAN -e shell install autorequire
For more information on module installation, please visit the detailed CPAN module installation guide.