in reply to perl: Argument list too long
I think the error must be coming from the shell invoking perl, not perl itself. The error would not be due to setting environment variables, but what is passed to $PERL_BIN/perl.
To confirm ...
- insert set -x just before the perl invocation line (to see the actual invocation; may want to set +x just after the perl line to avoid clutter in case perl call succeeds);
- replace $PERL_BIN/perl with echo ("argument list too long" message would still be produced);
- reduce the number of things stuffed in $@ (error message would enventually go away when "enough" -- consult your shell|kernel documentation|source -- of the arguments have been stripped away).
Thanks (rest of the posters) for the clue that environment is also part of the space calculation, which I had outright dismissed in my reply.
In Section Seekers of Perl Wisdom