Env::Assert(3pm)
π Env::Assert π
okay bestie, listen up β this is Env::Assert, a User Contributed Perl Documentation page, and it is exactly what it sounds like: it makes sure your environment variables are what you need them to be, or it aborts. no vibe-check failures allowed. periodt. π
β¨ NAME β¨
Env::Assert β make sure the environment variables match what you need, or abort.
πΈ VERSION πΈ
version 0.015
π¦ SYNOPSIS π¦
use Env::Assert 'assert';
# or:
use Env::Assert assert => {
envdesc_file => 'another-envdesc',
break_at_first_error => 1,
};
# .envdesc file:
# MY_VAR=.+
# use any verified environment variable
say $ENV{MY_VAR};
# You can inline the envdesc file:
use Env::Assert assert => {
exact => 1,
envdesc => <<'EOF'
NUMERIC_VAR=^[[:digit:]]+$
TIME_VAR=^\d{2}:\d{2}:\d{2}$
EOF
};
so basically: you use it, you either point it at a .envdesc file or you inline one with envdesc, and once everything checks out you can just... use your verified env vars like $ENV{MY_VAR}. icon behavior. π
π STATUS π
ngl, Package Env::Assert is currently being developed, so changes in the API are possible β though not likely. so like, technically it could shift but probably not. she's stable-ish. π«Ά
π NOTES π
heads up bestie: the functionality of Env::Assert has been moved to module Env::Assert::Functions since version 0.013. and Env::Assert has a different API now. so if you're reading old docs, that's why nothing matches β she changed, she grew, it's giving glow-up. π«
π₯ METHODS π₯
π assert_env
Read environment description β .envdesc by default β and compare current environment. that's the whole job. she reads, she compares, she decides if you're valid. π―
π DEPENDENCIES π
No external dependencies outside Perl's standard distribution. literally none. zero. she's self-sufficient, main character energy, no entourage needed. π
π SEE ALSO π
Env::Dot is a "sister" to Env::Assert β read environment variables from a .env file directly into your program. π«Ά
There's also script envdot, which can turn a .env file's content into environment variables for different shells. versatile queen. πβ¨
π AUTHOR π
Mikko Koivunalho <mikkoi@cpan.org>
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2023 by Mikko Koivunalho.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
fr fr, that's the whole page β every flag, every default, every path, untouched. no cap. π
okay and that's a wrap, bestie β this was Env::Assert, page 3pm, from perl v5.40.1, dated 2025-12-21. slay, go assert those env vars. ππ
β¨
π¦ where this page comes from
- ubuntu resolute: env-assert 0.015-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: env-assert 0.015-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms