NAME

Bio::Phylo::Util::CONSTANT - Global constants and utility functions

DESCRIPTION

This package defines globals used in the Bio::Phylo libraries. The constants are called internally by the other packages, they have no direct usage. In addition, several useful subroutines are optionally exported, which are described below.

SUBROUTINES

The following subroutines are utility functions that can be imported using:

use Bio::Phylo::Util::CONSTANT ':functions';

The subroutines use prototypes for more concise syntax, e.g.:

looks_like_number $num;
looks_like_object $obj, $const;
looks_like_hash @_;
looks_like_class $class;

These subroutines are used for argument processing inside method calls.

looks_like_number()

Tests if argument looks like a number.

Type    : Utility function
Title   : looks_like_number
Usage   : do 'something' if looks_like_number $var;
Function: Tests whether $var looks like a number.
Returns : TRUE or undef
Args    : $var = a variable to test
looks_like_object()

Tests if argument looks like an object of specified type constant.

Type    : Utility function
Title   : looks_like_object
Usage   : do 'something' if looks_like_object $obj, $const;
Function: Tests whether $obj looks like an object.
Returns : TRUE or throws ObjectMismatch
Args    : $obj   = an object to test
		   $const = a constant as defined in this package
looks_like_hash()

Tests if argument looks like a hash.

Type    : Utility function
Title   : looks_like_hash
Usage   : do 'something' if looks_like_hash @_;
Function: Tests whether argument looks like a hash.
Returns : hash (same order as arg) or throws OddHash
Args    : An array of hopefully even key/value pairs
looks_like_class()

Tests if argument looks like a loadable class name.

Type    : Utility function
Title   : looks_like_class
Usage   : do 'something' if looks_like_class $class;
Function: Tests whether argument looks like a class.
Returns : $class or throws ExtensionError
Args    : A hopefully loadable class name

SEE ALSO

Bio::Phylo::Manual

Also see the manual: Bio::Phylo::Manual and http://rutgervos.blogspot.com.

REVISION

$Id: CONSTANT.pm 841 2009-03-04 23:07:30Z rvos $