Re: retrieving a constant from a dynamically loaded module
- From: Gunnar Hjalmarsson <noreply@xxxxxxxxx>
- Date: Wed, 26 Oct 2005 12:36:18 +0200
olivier.grant@xxxxxxxxx wrote:
I need to be able to dynamically load a module and retrieve a constant from it. Simply put, i want to allow a user to specify a module HisModule.pm containing the package HisModule and get HisModule::VERSION.
in his file : [code] package HisModule; use constant VERSION; 1; [/code]
in my code : [code] $module = shift @ARGV;
chomp $module; require $module;
print " Using module v".$module::VERSION."\n"; [/code]
-- Gunnar Hjalmarsson Email: http://www.gunnar.cc/cgi-bin/contact.pl .
- Follow-Ups:
- Re: retrieving a constant from a dynamically loaded module
- From: olivier . grant
- Re: retrieving a constant from a dynamically loaded module
- References:
- retrieving a constant from a dynamically loaded module
- From: olivier . grant
- retrieving a constant from a dynamically loaded module
- Prev by Date: retrieving a constant from a dynamically loaded module
- Next by Date: Re: retrieving a constant from a dynamically loaded module
- Previous by thread: retrieving a constant from a dynamically loaded module
- Next by thread: Re: retrieving a constant from a dynamically loaded module
- Index(es):