App::envfile - runs another program with environment modified according to envfile
$ cat > foo.env FOO=bar HOGE=fuga $ envfile foo.env perl -le 'print "$ENV{FOO}, $ENV{HOGE}"' bar, fuga
like
$ env FOO=bar HOGE=fuga perl -le 'print "$ENV{FOO}, $ENV{HOGE}"'
App::envfile is sets environment from file.
envfile inspired djb's envdir program.
Create App::envfile instance.
my $envf = App::envfile->new();
Runs another program with environment modified according to \%env.
\%env
$envf->run_with_env(\%env, \@commands);
Parse the envfile. Returned value is HASHREF.
envfile
my $env = $envf->parse_envfile($envfile);
Supported file format are:
KEY=VALUE # comment KEY2=VALUE ...
Or more supported Perl, JSON and YAML format. The file format is determined by the extension type. extensions map are:
Perl
JSON
YAML
pl => Perl perl => Perl js => JSON json => JSON yml => YAML yaml => YAML
If this list does not match then considers that file is envfile.
Also, if you use YAML and JSON, Data::Encoder and YAML or JSON module is required.
xaicron <xaicron@cpan.org>
tokuhirom
Copyright 2011 - xaicron
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install App::envfile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::envfile
CPAN shell
perl -MCPAN -e shell install App::envfile
For more information on module installation, please visit the detailed CPAN module installation guide.