Test2::Handle(3) User Contributed Perl Documentation Test2::Handle(3)

# [NAME](#NAME)

Test2::Handle - Base class for Test2 handles used in V# bundles.

# [DESCRIPTION](#DESCRIPTION)

This is what you interact with when you use the T2() function in a test that uses Test2::V1.

# [SYNOPSIS](#SYNOPSIS)

## [RECOMMENDED](#RECOMMENDED)

```
    use Test2::V1;
    my $handle = T2();
    $handle->ok(1, "Passing Test");
```

## [WITHOUT SUGAR](#WITHOUT_SUGAR)

```
    use Test2::Handle();
    my $handle = Test2::Handle->new(base => 'Test2::V1::Base');
    $handle->ok(1, "Passing test");
```

# [METHODS](#METHODS)

Most methods are delegated to the base class provided at construction. There are however a few methods that are defined by this package itself.

$base = $class\_or\_inst-&gt;DEFAULT\_HANDLE\_BASE

Get the default handle base. This throws an exception on the base handle class, you should override it in a subclass.

$base = $inst-&gt;HANDLE\_BASE

In this base class this method always throws an exception. In a subclass it should return the default base class to use for that subclass.

$namespace = $inst-&gt;HANDLE\_NAMESPACE

Get the namespace used to store function we wrap as methods.

@sub\_names = $inst-&gt;HANDLE\_SUBS

Get a list of all subs available in the handle namespace.

$inst-&gt;HANDLE\_INCLUDE($package, @subs)

Import the specified subs from the specified package into our internal namespace.

$inst = $class-&gt;**import()**

Used to create a T2() sub in your namespace at import.

$inst-&gt;**init()**

Internally used to initialize and validate the handle object.

[AUTOLOAD](#AUTOLOAD)

Internally used to wrap functions as methods.

# [SOURCE](#SOURCE)

The source code repository for Test2-Suite can be found at *https://github.com/Test-More/test-more/*.

# [MAINTAINERS](#MAINTAINERS)

[Chad Granum &lt;exodist@cpan.org&gt;](#Chad)

# [AUTHORS](#AUTHORS)

[Chad Granum &lt;exodist@cpan.org&gt;](#Chad~2)

# [COPYRIGHT](#COPYRIGHT)

Copyright Chad Granum &lt;exodist@cpan.org&gt;.

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

See *http://dev.perl.org/licenses/*

2026-09-04 perl v5.44.0

---

Document: Test2::Handle(3pm) from perl-test-simple 1.302225-r0 (Chainguard OS)
Source: https://github.com/Test-More/test-more
