Perl-Types

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN

    use perltypes;    # pragma style
    # OR
    use types;        # pragma style, shortened

    # declare a typed scalar
    my integer $i = 42;

    # declare a typed compound reference
    my arrayref::integer $arr = [1, 2, 3];
```

[comment]: # DEV NOTE, CORRELATION #gt00: copy all project abstract changes between 'README.md' header & "# ABSTRACT" & POD in main module; copy all description changes between 'README.md' header & main module POD

```console
$ docker run -it perlcommunity/perl-types
# OR
$ apt-get install perl-perl-types
# OR
$ cpanm Perl::Types
```

[Docker Hub Releases](https://hub.docker.com/r/perlcommunity/perl-types "View Docker Hub releases")

[OS Package Releases](https://packages.perlcommunity.org/perl-types "View OS-specific package releases")

[CPAN Releases](https://metacpan.org/pod/Perl::Types "View CPAN distribution releases")

[Code Build/Test Current via GitLab CI Pipelines](https://gitlab.com/perl-types/perl-types/-/pipelines/latest "View latest auto-generated code build/test info")

[Code Build/Test History via GitLab CI Pipelines](https://gitlab.com/perl-types/perl-types/-/pipelines "View past auto-generated code build/test info")

[Code Test Cases Current via TAP::Harness::JUnit (CLICK "Tests" TAB)](https://gitlab.com/perl-types/perl-types/-/pipelines/latest "View latest auto-generated code test case info")

[Code Coverage Current via Devel::Cover::Report::Html](https://perl-types.gitlab.io/perl-types/ "View latest auto-generated code coverage info")

[Code Coverage History via Devel::Cover::Report::Cobertura](https://gitlab.com/perl-types/perl-types/-/graphs/main/charts "View past auto-generated code coverage info")

## USERS: Docker Commands

```console
# install Docker & Docker Compose if you haven't already, confirm it runs;
# look up installation instructions for "docker-ce" instead of "docker.io" if you need the very latest version of Docker
$ sudo apt-get install docker.io docker-buildx docker-compose-v2
$ docker compose version

# use `docker` to download & run Docker image from Docker Hub
$ docker run -it perlcommunity/perl-types

# use `docker` to build local Docker base image & Docker application image
$ docker build -t base:dev -f Dockerfile .
$ docker build -t app:dev -f docker/Dockerfile.app .

# use `docker` to run local Docker application image
$ docker run -it --rm app:dev

# use `docker` to run local Docker application image with one-off command, in this case `prove` to run Perl tests
$ docker run -it --rm app:dev prove -Ilib -r t

# use `docker` to run local Docker application image in Live Developer Mode;
# mount the repository from the host OS's current directory into the '/app' Docker working directory,
# thereby overlaying the copy of the repository that was baked into the Docker application image
# with the latest copy of the respository from the host operating system;
# this allows live edits on the host OS to be immediately reflected within the Docker application
$ docker run -it --rm -v "$PWD:/app" -e PERL_VERBOSE=1 -e PERL_DEBUG=1 -e PERL_WARNINGS=1 app:dev

# use `docker compose` to build local Docker images
$ docker compose build base app

# use `docker compose` to run local Docker application image in Live Developer Mode via settings in 'docker-compose.yml'
$ docker compose run --rm app

# use `docker compose` to run local Docker application image in Live Developer Mode via settings in 'docker-compose.yml'
# with one-off command, in this case `prove` to run Perl tests
$ docker compose run --rm app prove -Ilib -r t
```

## USERS: Install Perl Dependencies

```console
# install static CPAN dependencies
$ dzil authordeps --missing | cpanm --notest --verbose
$ dzil listdeps   --missing | cpanm --notest --verbose
```

## USERS: Run & Test Perl Code

```console
# run all tests via `dzil`, creates new tests so may not always work properly
$ dzil test

# run all tests via `prove`
$ prove -v t/*.t

# run individual tests via `perl`
$ perl t/00_foo.t
```

## DEVELOPERS: Perl::Types & Perl::Config

The Docker application image comes with the Perl data type system built in and ready to use.  If you are not using Docker, then you will need to manually install the GCC compiler and libraries; please see the `Dockerfile` for more details about the n...

Perl::Types usage details are in the POD:
[Perl::Types on MetaCPAN](https://metacpan.org/pod/Perl::Types "View latest Perl::Types documentation")

Along with Perl::Types comes Perl::Config, which (among other things) provides you with 3 very useful environmental variables:

```console
# default 0
$ export PERL_VERBOSE=1

# default 0
$ export PERL_DEBUG=1

# default 1
$ export PERL_WARNINGS=1
```

These 3 environmental variables control the visibility of the output generated by the following Perl subroutines, respectively:

```perl
# always include Perl::Types



( run in 0.966 second using v1.01-cache-2.11-cpan-39bf76dae61 )