Christian Hansen

NAME

Net::FastCGI::Util - Provides utility functions and constants intended for internal use only.

SYNOPSIS

     carp('Foo Bar');
     carpf('Foo %s' 'Bar');
     
     croak('Foo Bar');
     croakf('Foo %s', 'Bar');
     
     $boolean = is_cvref($scalar);
     $boolean = is_hvref($scalar);
     $boolean = is_instance_of($scalar, $class);
     $boolean = is_object($scalar);
     $boolean = is_octets($scalar);
     $boolean = is_octets_ge($scalar, $minimum);
     $boolean = is_octets_le($scalar, $maximum);
     $boolean = is_uint($scalar);
     $boolean = is_uint8($scalar);
     $boolean = is_uint16($scalar);
     $boolean = is_uint31($scalar);
     $boolean = is_uint32($scalar);

DESCRIPTION

Provides utility functions and constants intended for internal use within Net::FastCGI.

FUNCTIONS

carp

Usage

    carp(@message);

Arguments

@message

carpf

Usage

    carpf($format, @list);

Arguments

$format
@list

croak

Usage

    croak(@message);

Arguments

@message

croakf

Usage

    croakf($format, @list);

Arguments

$format
@list

is_cvref

Usage

    $boolean = is_cvref($scalar);
    $boolean = is_cvref( sub {} );        # true
    $boolean = is_cvref( \&is_cvref );    # true
    $boolean = is_cvref( bless(sub {}) ); # false

Arguments

$scalar

Returns

$boolean

A boolean indicating whether or not $scalar is a unblessed code reference.

is_hvref

Usage

    $boolean = is_hvref($scalar);
    $boolean = is_hvref( {} );        # true
    $boolean = is_hvref( bless({}) ); # false

Arguments

$scalar

Returns

$boolean

A boolean indicating whether or not $scalar is a unblessed hash reference.

is_handle

Usage

    $boolean = is_handle($scalar);
    $boolean = is_handle(*STDOUT);         # true
    $boolean = is_handle(\*STDOUT);        # true
    $boolean = is_handle(IO::Handle->new); # true
    $boolean = is_handle(IO::String->new); # true
    $boolean = is_handle(STDOUT);          # false

Arguments

$scalar

Returns

$boolean

A boolean indicating whether or not $scalar is a handle.

is_instance_of

Usage

    $boolean = is_instance_of($scalar, $class);

Arguments

$scalar
$class

Returns

$boolean

A boolean indicating whether or not $scalar is an instance of $class.

is_object

Usage

    $boolean = is_object($scalar);

Arguments

$scalar

Returns

$boolean

A boolean indicating whether or not $scalar is an object.

is_octets

Usage

    $boolean = is_octets($scalar);

Arguments

$scalar

Returns

$boolean

A boolean indicating whether or not $scalar is octets.

is_octets_ge

Usage

    $boolean = is_octets_ge($scalar, $low);

Arguments

$scalar
$low

An unsigned integer.

Returns

$boolean

A boolean indicating whether or not $scalar is octets and is greater than or equal to $low in length.

is_octets_le

Usage

    $boolean = is_octets_le($scalar, $high);

Arguments

$scalar
$high

An unsigned integer.

Returns

$boolean

A boolean indicating whether or not $scalar is octets and is less than or equal to $high in length.

is_uint

Usage

    $boolean = is_uint($scalar);

Arguments

$scalar

Returns

$boolean

A boolean indicating whether or not $scalar is an unsigned integer.

is_uint8

Usage

    $boolean = is_uint8($scalar);

Arguments

$scalar

Returns

$boolean

A boolean indicating whether or not $scalar is an unsigned 8-bit integer.

is_uint16

Usage

    $boolean = is_uint16($scalar);

Arguments

$scalar

Returns

$boolean

A boolean indicating whether or not $scalar is an unsigned 16-bit integer.

is_uint31

Usage

    $boolean = is_uint31($scalar);

Arguments

$scalar

Returns

$boolean

A boolean indicating whether or not $scalar is an unsigned 31-bit integer.

is_uint32

Usage

    $boolean = is_uint32($scalar);

Arguments

$scalar

Returns

$boolean

A boolean indicating whether or not $scalar is an unsigned 32-bit integer.

CONSTANTS

ERRMSG_CVREF

Argument "%s" is not a CODE reference

ERRMSG_HVREF

Argument "%s" is not a HASH reference

ERRMSG_INSTANCE_OF

Argument "%s" is not an instance of "%s"

ERRMSG_OCTETS_GE

Argument "%s" must be greater than or equal to %u octets in length

ERRMSG_OCTETS_LE

Argument "%s" must be less than or equal to %u octets in length

ERRMSG_OFFSET

Argument "%s" is outside of octets length

ERRMSG_UINT

Argument "%s" is not an unsigned integer

ERRMSG_UINT8

Argument "%s" is not an unsigned 8-bit integer

ERRMSG_UINT16

Argument "%s" is not an unsigned 16-bit integer

ERRMSG_UINT31

Argument "%s" is not an unsigned 31-bit integer

ERRMSG_UINT32

Argument "%s" is not an unsigned 32-bit integer

ERRMSG_VERSION

Unsupported FastCGI version: %u

EXPORTS

None by default. Functions and constants can either be imported individually or in sets grouped by tag names. The tag names are:

:all exports all functions and constants.
:carp exports carp, carpf, croak, and croakf.
:errmsg exports all ERRMSG_ constants.
:predicate exports all is_ functions.
:common exports :carp, :errmsg and :predicate.

AUTHOR

Christian Hansen chansen@cpan.org

COPYRIGHT

Copyright (c) 2008 Christian Hansen. All rights reserved.

This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.