The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

PerlX::Underscore - Common helper functions without having to import them

VERSION

version v0.1.0

SYNOPSIS

    use PerlX::Underscore;
    
    _::croak "$foo must do Some::Role" if not _::does($foo, 'Some::Role');

DESCRIPTION

This module contains various utility functions, and makes them accessible through the _ package. This allows the use of these utilities (a) without much per-usage overhead and (b) without namespace pollution.

It contains functions from the following modules:

Not all functions from those are available, and some have been renamed.

FUNCTION REFERENCE

Scalar::Util

_::blessed $object
_::class $object

wrapper for Scalar::Util::blessed

_::ref_addr $ref

wrapper for Scalar::Util::refaddr

_::ref_type $ref

wrapper for Scalar::Util::reftype

_::ref_weaken $ref

wrapper for Scalar::Util::weaken

_::ref_unweaken $ref

wrapper for Scalar::Util::unweaken

_::ref_is_weak $ref

wrapper for Scalar::Util::isweak

List::Util and List::MoreUtils

_::reduce { BLOCK } @list

wrapper for List::Util::reduce

_::any { PREDICATE } @list

wrapper for List::Util::any

_::all { PREDICATE } @list

wrapper for List::Util::all

_::none { PREDICATE } @list

wrapper for List::Util::none

_::first { PREDICATE } @list

wrapper for List::MoreUtils::first_value

_::first_index { PREDICATE } @list

wrapper for List::MoreUtils::first_index

_::last { PREDICATE } @list

wrapper for List::MoreUtils::last_value

_::last_index { PREDICATE } @list

wrapper for List::MoreUtils::last_index

_::max @list
_::max_str @list

wrappers for List::Util::max and List::Util::maxstr, respectively.

_::min @list
_::min_str @list

wrappers for List::Util::min and List::Util::minstr, respectively.

_::sum 0, @list

wrapper for List::Util::sum

_::product @list

wrapper for List::Util::product

_::pairgrep { PREDICATE } @kvlist

wrapper for List::Util::pairgrep

_::pairfirst { PREDICATE } @kvlist

wrapper for List::Util::pairfirst

_::pairmap { BLOCK } @kvlist

wrapper for List::Util::pairmap

_::shuffle @list

wrapper for List::Util::shuffle

_::natatime $size, @list

wrapper for List::MoreUtils::natatime

_::zip @list1, @list2, ...

wrapper for List::MoreUtils::zip

_::uniq @list

wrapper for List::MoreUtils::uniq

_::part { INDEX_FUNCTION } @list

wrapper for List::MoreUtils::part

Carp

_::carp "Message"

wrapper for Carp::carp

_::cluck "Message"

wrapper for Carp::cluck

_::croak "Message"

wrapper for Carp::croak

_::confess "Message"

wrapper for Carp::confess

UNIVERSAL

...and other goodies from Safe::Isa

_::isa $object, 'Class'

wrapper for $Safe::Isa::_isa

_::can $object, 'method'

wrapper for $Safe::Isa::_can

_::does $object, 'Role'

wrapper for $Safe::Isa::_DOES

$maybe_object->_::safecall(method => @args)

wrapper for $Safe::Isa::_call_if_object

BUGS

Please report any bugs or feature requests on the bugtracker website https://github.com/latk/Underscore/issues

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

Lukas Atkinson <amon@cpan.org>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2014 by Lukas Atkinson.

This is free software, licensed under:

  The GNU General Public License, Version 3, June 2007