Previous Page
Next Page

D.3. Utility Subroutines

Subroutine

Description

Available From

all( )

Returns true if all its arguments are true (see Chapter 8)

List::MoreUtils

anon_scalar( )

Returns a reference to an anonymous scalar (see Chapters 15 and 16)

Class::Std::Utils

any( )

Returns true if any of its arguments are true (see Chapters 4 and 8)

List::MoreUtils

apply( )

Applies a transformation to its list of arguments (see Chapter 8)

List::MoreUtils

blessed( )

Returns true if its argument is a reference to a blessed object (see Chapter 8)

Scalar::Util

carp( )

Prints a warning like warn does, but reports it from the caller's location (see Chapters 2, 6, 9, and 13)

Carp

cmp_these( )

Times a set of alternative code fragments and compares the results in a table (see Chapter 19)

Benchmark

croak( )

Throws an exception like die does, but reports it from the caller's location (see Chapters 2, 6, 9, and 13)

Carp

first( )

Returns the first of its arguments that satisfies some test (see Chapters 2 and 8)

List::Util

first_index( )

Returns the index of the first of its arguments that satisfies some test (see Chapter 8)

List::MoreUtils

form( )

Formats data into fixed-field reports (see Chapters 5 and 19)

Perl6::Form

ident( )

Returns a unique identifier for an object (see Chapters 15 and 16)

Class::Std::Utils

interactive( )

Returns an output filehandle that ignores output unless the current process is interactive (see Chapter 10)

IO::Interactive

is( )

Tests whether its arguments are equal and reports accordingly (see Chapters 17 and 18)

Test::More

is_interactive( )

Returns true if the current process is interactive (see Chapter 10)

IO::Interactive

is_weak( )

Returns true if its argument is a reference that is invisible to the garbage collector (see Chapter 8)

Scalar::Util

looks_like_number( )

Returns true if the argument is something Perl could convert to a number (see Chapter 8)

Scalar::Util

make_sorter( )

Generates efficient sorting routines (see Chapter 8)

Sort::Maker

max( )

Returns the maximum of a list of numbers (see Chapters 2 and 8)

List::Util

maxstr( )

Returns the lexicographically last value from a list of strings (see Chapter 8)

List::Util

memoize( )

Causes a subroutine to cache its return values (see Chapter 19)

Memoize

min( )

Returns the minimum of a list of numbers (see Chapter 8)

List::Util

minstr( )

Returns the lexicographically first value from a list of strings (see Chapter 8)

List::Util

none( )

Returns true if none of its arguments is true (see Chapter 8)

List::MoreUtils

notall( )

Returns true if any of its arguments is false (see Chapter 8)

List::MoreUtils

ok( )

Tests whether a condition is true and reports accordingly (see Chapters 17 and 18)

Test::Simple

openhandle( )

Returns true if its argument is an open filehandle (see Chapter 8)

Scalar::Util

pairwise( )

Applies a specified binary operation between corresponding elements of two arrays (see Chapter 8)

List::MoreUtils

prompt( )

Prints a prompt, reads some input, verifies it, and returns it (see Chapters 10 and 17)

IO::Prompt

qv( )

Creates a version number object (see Chapter 17)

version

readonly( )

Returns true if its argument is not assignable (see Chapter 8)

Scalar::Util

read_file( )

Reads and returns the entire contents of a file (see Chapters 8 and 10)

File::Slurp

reduce( )

Applies a specified binary operation between every adjacent element in a list (see Chapter 8)

List::Util

refaddr( )

Returns the address of a reference, as an integer (see Chapters 8 and 15)

Scalar::Util

reftype( )

Returns a string representing the underlying type of a reference (see Chapter 8)

Scalar::Util

shuffle( )

Returns its arguments in a (pseudo)random order (see Chapter 8)

List::Util

size( )

Returns the amount of memory used to store the data in its argument (see Chapter 19)

Devel::Size

slurp( )

Reads the entire contents of a file (see Chapters 10 and 17)

Perl6::Slurp

sum( )

Returns the numeric sum of its arguments (see Chapter 8)

List::Util

tainted( )

Returns true if its argument is tainted (see Chapter 8)

Scalar::Util

total_size( )

Returns the amount of memory used to store the data and implementation of its argument (see Chapter 19)

Devel::Size

uniq( )

Returns its list of arguments with any duplicates removed (see Chapter 8)

List::MoreUtils

usleep( )

Sleeps a specified number of microseconds (see Chapter 8)

Time::HiRes

weaken( )

Hides a reference from the garbage collector (see Chapters 8 and 11)

Scalar::Util

zip( )

Interleaves values from two or more arrays (see Chapter 8)

List::MoreUtils


    Previous Page
    Next Page