NAME
GX::Meta::Util - Utility functions
SYNOPSIS
None.
DESCRIPTION
This module provides various utility functions.
FUNCTIONS
Public Functions
eval_code
Compiles the given Perl source code and returns the result.
$result = eval_code( $source, $variables );
- Arguments:
-
$source
( string )$variables
(HASH
reference ) [ optional ]
- Returns:
-
$result
( scalar )
file_to_module_name
Returns the module name for the given filename.
$module = file_to_module_name( $file );
find_module_file
Returns the absolute path to the file the specified module would currently be loaded from, or undef
if the module file cannot be found in any of the @INC
paths.
$path = find_module_file( $module );
find_modules
Returns a list with the names of the modules located in the specified directory.
@modules = find_modules( $directory, $base_directory );
- Arguments:
-
$directory
( string )$base_directory
( string ) [ optional ]
- Returns:
-
@modules
( strings )
load_module
Tries to load the specified module, returning true on success and false on failure. Compile errors are not trapped.
$result = load_module( $module );
In void context, load_module()
throws a GX::Meta::Exception if the module cannot be loaded.
load_module( $module );
module_inc_file
Returns the absolute path to the file the specified module was loaded from, or undef
if the module is not loaded or was not loaded from a file.
$path = module_inc_file( $module );
module_inc_key
Returns the %INC
key for the specified module.
$key = module_inc_key( $module );
module_inc_value
Returns / sets the %INC
value for the specified module.
$value = module_inc_value( $module );
$value = module_inc_value( $module, $value );
module_is_installed
Returns true if the specified module is installed, otherwise false.
$result = module_is_installed( $module );
module_is_loaded
Returns true if the specified module is loaded, otherwise false.
$result = module_is_loaded( $module );
module_to_file_name
Returns the localized filename for the specified module.
$file = module_to_file_name( $module );
subpackage_names
Returns a list with the (unqualified) names of the subpackages of the specified package.
@names = subpackage_names( $package );
unload_module
Unloads the specified module.
unload_module( $module );
wipe_package
Undefines every symbol that lives in the symbol table of the specified package. Danger, Will Robinson!
wipe_package( $package );
SEE ALSO
AUTHOR
Jörg A. Uzarek <uzarek@runlevelnull.de>
COPYRIGHT AND LICENSE
Copyright (c) 2009-2011 Jörg A. Uzarek.
This module is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation.