File: embed-envdesc-when-use.pl

package info (click to toggle)
env-assert 0.015-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 424 kB
  • sloc: perl: 1,877; makefile: 8; sh: 7
file content (17 lines) | stat: -rwxr-xr-x 326 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env perl
use strict;
use warnings;
use 5.010;
use Carp;

use Env::Assert assert => {
    exact => 0,
    envdesc => <<'EOF'
USER=^[[:word:]]+$
SHELL=^[[:word:]\/-]+$
EOF
};

say 'My env is all good!' || croak 'Cannot say';
say "My name is '$ENV{USER}' and my shell is '$ENV{SHELL}'." || croak 'Cannot say';
exit 0;