Test::File::ShareDir::Object::Module(3) User Contributed Perl Documentation Test::File::ShareDir::Object::Module(3)

# [NAME](#NAME)

Test::File::ShareDir::Object::Module - Object Oriented ShareDir creation for modules

# [VERSION](#VERSION)

version 1.001002

# [SYNOPSIS](#SYNOPSIS)

```
    use Test::File::ShareDir::Object::Module;
    my $dir = Test::File::ShareDir::Object::Module->new(
        root    => "some/path",
        modules => {
            "Hello::Nurse" => "share/HN"
        },
    );
    $dir->install_all_modules;
    $dir->add_to_inc;
```

# [METHODS](#METHODS)

## ["module\_names"](#_module_names_)

```
    my @names = $instance->module_names();
```

Returns the names of all modules listed in the "modules" set.

## ["module\_share\_target\_dir"](#_module_share_target_dir_)

```
    my $dir = $instance->module_share_target_dir("Module::Name");
```

Returns the path where the "ShareDir" will be created for "Module::Name"

## ["module\_share\_source\_dir"](#_module_share_source_dir_)

```
    my $dir = $instance->module_share_source_dir("Module::Name");
```

Returns the path where the "ShareDir" will be **COPIED** *FROM* for "Module::Name"

## ["install\_module"](#_install_module_)

```
    $instance->install_module("Module::Name");
```

Installs "Module::Name"'s "ShareDir"

## ["install\_all\_modules"](#_install_all_modules_)

```
    $instance->install_all_modules();
```

Installs all "module\_names".

## ["add\_to\_inc"](#_add_to_inc_)

**DEPRECATED:** Use "register" instead.

## ["register"](#_register_)

```
    $instance->register();
```

Adds the "Tempdir" "ShareDir" ( "inc" ) to the global @INC

*Since 1.001000*

## ["clear"](#_clear_)

```
    $instance->clear();
```

Removes the "Tempdir" "ShareDir" ( "inc" ) from the global @INC

*Since 1.001000*

# [ATTRIBUTES](#ATTRIBUTES)

## ["inc"](#_inc_)

A "Test::File::ShareDir::Object::Inc" object.

## ["modules"](#_modules_)

A hash of :

```
    Module::Name => "relative/path"
```

## ["root"](#_root_)

The origin all paths's are relative to.

( Defaults to "cwd" )

# [AUTHOR](#AUTHOR)

Kent Fredric &lt;kentnl@cpan.org&gt;

# [COPYRIGHT AND LICENSE](#COPYRIGHT_AND_LICENSE)

This software is copyright (c) 2017 by Kent Fredric &lt;kentnl@cpan.org&gt;.

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

2026-04-22 perl v5.42.2

---

Document: Test::File::ShareDir::Object::Module(3pm) from perl-test-file-sharedir 1.001002-r1 (Chainguard OS)
Source: https://github.com/kentnl/Test-File-ShareDir
