[dancer-users] Running bin/app.pl with cleaner %ENV

Lars Dɪᴇᴄᴋᴏᴡ 迪拉斯 daxim at cpan.org
Tue Mar 5 08:03:10 GMT 2013

Read <http://man.cx/env>.

Start with empty environment:

    env -i /absolute/path/to/bin/perl -Mautodie=:all \
        -e'exec($^X, "/absolute/path/to/bin/app.pl")'

Empty, but keep certain useful variables:

    env -i PATH=$PATH LANG=$LANG /absolute/path/to/bin/perl \
        -Mautodie=:all -e'exec($^X, "/absolute/path/to/bin/app.pl")'

Delete certain variables, but keep the rest:

    perl -Mautodie=:all -e'
        delete @ENV{qw(LS_COLORS TERM)};
        exec($^X, "/absolute/path/to/bin/app.pl");

All code is untested.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20130305/1b7bd508/attachment-0001.pgp>

More information about the dancer-users mailing list