File::DataClass::Functions - Common functions used in this distribution
use File::DataClass::Functions qw(list of functions to import);
Common functions used in this distribution
ensure_class_loaded( $some_class, \%options );
Require the requested class, throw an error if it doesn't load
$map = extension_map; # Accessor $value = extension_map $class, $extensions; # Mutator
An accessor / mutator for the stateful hash reference that maps filename extensions onto storage classes. Calling the accessor populates the extension map on first use. Storage subclasses call the mutator to register the extensions that they handle. If the $extensions parameter is an array reference then the storage subclass can "claim ownership" of more than one extension in a single call
$extensions
$single_char = first_char $some_string;
Returns the first character of $string
$string
$bool = is_arrayref $scalar_variable
Tests to see if the scalar variable is an array ref
$bool = is_coderef $scalar_variable
Tests to see if the scalar variable is a code ref
$bool = is_hashref $scalar_variable
Tests to see if the scalar variable is a hash ref
$bool = is_member q(test_value), qw(a_value test_value b_value);
Tests to see if the first parameter is present in the list of remaining parameters
$bool = is_stale $data, $cache_mtime, $path_mtime;
Returns true if there is no data or the cache mtime is older than the path mtime
$array_ref_of_class_name = map_extension2class $extension;
Maps a filename extensions to a storage classes
$dest = merge_attributes $dest, $src, $attr_list_ref;
Merges attribute hashes. The $dest hash is updated and returned. The $dest hash values take precedence over the $src hash values. The $src hash may be an object in which case its accessor methods are called
$dest
$src
merge_file_data $existing, $new;
Uses Hash::Merge to merge data from the new hash ref in with the existing
$storage_classname = qualify_storage_class $class_suffix;
Prepends the STORAGE_BASE classname to the supplied suffix
STORAGE_BASE
@list_of_extension_names = supported_extensions;
Returns a list of supported filename extensions
$thread_id = thread_id;
Returns the current thread id or zero if the the threads module has not been loaded
throw error => q(error_key), args => [ q(error_arg) ];
Expose "throw" in CatalystX::Usul::Exception. CX::Usul::Functions has a class attribute Exception_Class which can be set via a call to set_inherited
CX::Usul::Functions
set_inherited
None
There are no known incompatibilities in this module
There are no known bugs in this module. Please report problems to the address below. Patches are welcome
Larry Wall - For the Perl programming language
Peter Flanigan, <pjfl@cpan.org>
<pjfl@cpan.org>
Copyright (c) 2014 Peter Flanigan. All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic
This program is distributed in the hope that it will be useful, but WITHOUT WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
To install File::DataClass, copy and paste the appropriate command in to your terminal.
cpanm
cpanm File::DataClass
CPAN shell
perl -MCPAN -e shell install File::DataClass
For more information on module installation, please visit the detailed CPAN module installation guide.