File: TestEnv.pm

package info (click to toggle)
libmoo-perl 2.005005-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 840 kB
  • sloc: perl: 2,506; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 341 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package TestEnv;
use strict;
use warnings;

sub import {
  $ENV{$_} = 1
    for grep defined && length && !exists $ENV{$_}, @_[1 .. $#_];
  if ($ENV{MOO_FATAL_WARNINGS}) {
    my @opts = (
      '-Ixt/lib',
      '-MFatalWarnings',
      (exists $ENV{PERL5OPT} ? $ENV{PERL5OPT} : ()),
    );

    $ENV{PERL5OPT} = join ' ', @opts;
  }
}

1;