GX::Meta::Util - Utility functions
None.
This module provides various utility functions.
eval_code
Compiles the given Perl source code and returns the result.
$result = eval_code( $source, $variables );
$source ( string )
$source
$variables ( HASH reference ) [ optional ]
$variables
HASH
$result ( scalar )
$result
file_to_module_name
Returns the module name for the given filename.
$module = file_to_module_name( $file );
$file ( string )
$file
$module ( string )
$module
GX::Meta::Exception
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.
undef
@INC
$path = find_module_file( $module );
$path ( string | undef )
$path
find_modules
Returns a list with the names of the modules located in the specified directory.
@modules = find_modules( $directory, $base_directory );
$directory ( string )
$directory
$base_directory ( string ) [ optional ]
$base_directory
@modules ( strings )
@modules
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 );
$result ( bool )
In void context, load_module() throws a GX::Meta::Exception if the module cannot be loaded.
load_module()
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.
%INC
$key = module_inc_key( $module );
$key ( string )
$key
module_inc_value
Returns / sets the %INC value for the specified module.
$value = module_inc_value( $module ); $value = module_inc_value( $module, $value );
$value ( string ) [ optional ]
$value
$value ( string )
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 );
$package ( string )
$package
@names ( strings )
@names
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 );
GX::Meta
Jörg A. Uzarek <uzarek@runlevelnull.de>
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.
To install GX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GX
CPAN shell
perl -MCPAN -e shell install GX
For more information on module installation, please visit the detailed CPAN module installation guide.