Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rjray/env-export
Perl module to export environment variables as constant subs
https://github.com/rjray/env-export
Last synced: 9 days ago
JSON representation
Perl module to export environment variables as constant subs
- Host: GitHub
- URL: https://github.com/rjray/env-export
- Owner: rjray
- Created: 2009-03-17T23:22:31.000Z (almost 16 years ago)
- Default Branch: master
- Last Pushed: 2021-01-10T19:58:00.000Z (almost 4 years ago)
- Last Synced: 2023-04-13T08:26:45.511Z (over 1 year ago)
- Language: Perl
- Homepage: http://search.cpan.org/dist/Env-Export/
- Size: 38.1 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.textile
- Changelog: ChangeLog.xml
Awesome Lists containing this project
README
h1. Env::Export - Export environment variables as constant subroutines
Version: 0.22
h2. WHAT IS IT
This module allows the user to specify one or more environment variables that
should be "exported" to the calling namespace as constant subroutines. By
doing this, their existence/inexistence can be detected at compile-time.h2. USING Env::Export
The difference is in how you detect the absence of the environment variable
you need:
if (exists($ENV{PATH}) and ($ENV{PATH} =~ /.../))
{
# Do something
}versus:
use Env::Export 'PATH';if (PATH =~ /.../)
{
# Do something
}The first form performs two tests, the first to ensure that the second does
not cause a "Use of unitialized value in regular expression" warning. The
second form only performs one test, but it also generates a compile-time
error if there was no environment variable "PATH" present.h2. BUILDING/INSTALLING
This package provides a Makefile.PL file as is typical of CPAN modules.
Building and installing is as easy as:
perl Makefile.PL
make
make test
# If tests pass
make install(The "make install" step may require super-user privileges.)
h2. PROBLEMS/BUG REPORTS
Problems, bug reports, or suggestions for enhancements can be sent to the RT
instance set up for all CPAN-based distributions:bq. http://rt.cpan.org/NoAuth/Bugs.html?Dist=Env-Export
h2. CHANGES
* t/00_load.t (deleted)
* t/01_pod.t (deleted)
* t/02_pod_coverage.t (deleted)
* xt/00_load.t
* xt/01_pod.t
* xt/02_pod_coverage.tp{margin-bottom:2em}. Move author-only tests to the xt/ directory.
* t/20_regex.t
* t/25_glob.t
* t/40_all.tp{margin-bottom:2em}. Consider volume when creating path to sub_count.pl.
* t/10_basic.t
* t/80_split.tp{margin-bottom:2em}. Additions to increase code-coverage of tests.
* lib/Env/Export.pm
p{margin-bottom:2em}. Bug fixes, critic clean-up and some docs clean-up. Some fixes related to getting better code-coverage in test suites.
* lib/Env/Export.pm
p{margin-bottom:2em}. Removed a left-over debugging line, doc fixes.