Name

File::DataClass::Functions - Common functions used in this distribution

Version

This document describes version v0.26.$Rev: 1 $

Synopsis

use File::DataClass::Functions qw(list of functions to import);

Description

Common functions used in this distribution

Subroutines/Methods

ensure_class_loaded

ensure_class_loaded( $some_class, \%options );

Require the requested class, throw an error if it doesn't load

first_char

$single_char = first_char $some_string;

Returns the first character of $string

is_arrayref

$bool = is_arrayref $scalar_variable

Tests to see if the scalar variable is an array ref

is_coderef

$bool = is_coderef $scalar_variable

Tests to see if the scalar variable is a code ref

is_hashref

$bool = is_hashref $scalar_variable

Tests to see if the scalar variable is a hash ref

is_member

$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

is_stale

$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

merge_attributes

$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

merge_file_data

merge_file_data $existing, $new;

Uses Hash::Merge to merge data from the new hash ref in with the existing

thread_id

$thread_id = thread_id;

Returns the current thread id or zero if the the threads module has not been loaded

throw

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

Configuration and Environment

None

Diagnostics

None

Dependencies

Class::Load
Exporter
Hash::Merge
Try::Tiny

Incompatibilities

There are no known incompatibilities in this module

Bugs and Limitations

There are no known bugs in this module. Please report problems to the address below. Patches are welcome

Acknowledgements

Larry Wall - For the Perl programming language

Author

Peter Flanigan, <Support at RoxSoft.co.uk>

License and Copyright

Copyright (c) 2013 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