---
name: "App::perlimports::ExportInspector"
section: "3pm"
platform: "linux"
package: "perlimports"
version: "0.000057-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/App::perlimports::ExportInspector"
---

# App::perlimports::ExportInspector(3pm)

Inspect code for exportable symbols

## NAME

App::perlimports::ExportInspector - Inspect code for exportable symbols

## VERSION

version 0.000057

## SYNOPSIS

```
    use strict;
    use warnings;
    use App::perlimport::ExportInspector ();
    my $ei = App::perlimport::ExportInspector->new(
        module_name => 'Carp',
    );
    my $exports = $ei->explicit_exports;
```

## DESCRIPTION

Inspect modules to see what they might export.

## MOTIVATION

Since we're (maybe) importing symbols as part of this process, we've sandboxed it a little bit by not doing it in App::perlimports directly.

## METHODS

The following methods are available.

### implicit\_exports

A HashRef with keys representing symbols which a module implicitly exports (i.e.  via `"use Module::Name;"`. The values represent the import value which you would need in order to explicitly import the symbol. Often these will be the same, but there are exceptions. For example, a type library may export `"is_ArrayRef"`, but you import it via `"use My::Type::Library qw( ArrayRef );"`.

### explicit\_exports

A HashRef with keys representing symbols which a module explicitly exports (i.e.  via `"use Module::Name qw( foo bar );"`. The values represent the import value which you would need in order to explicitly import the symbol. Often these will be the same, but there are exceptions. For example, a type library may export `"is_ArrayRef"`, but you import it via `"use My::Type::Library qw(` `ArrayRef );"`.

In cases where we cannot be certain about the explicit exports, you can try to fall back to the implicit exports to get an idea of what this module can export.

### evals\_ok

Returns true if either implicit or explicit exports can be built without setting `$@`.

### implicit\_export\_names\_match\_values

Returns true if the keys and values in `"implicit_exports"` match.

### explicit\_export\_names\_match\_values

Returns true if the keys and values in `"explicit_exports"` match.

### success\_counter

Returns an integer representing the number of times we were able to execute eval statements for this package which did not pollute `$@`.

## CAVEATS

This may not work with modules using some creative way of managing symbol exports.

## AUTHOR

Olaf Alders \<olaf@wundercounter.com\>

## COPYRIGHT AND LICENSE

This software is copyright (c) 2020 by Olaf Alders.

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