in reply to get environment variables from a bourne file

Unrelated to your main problem...
%ENV = { %ENV, %BB_ENV };
If you use strict and warnings, it will alert you that there is something wrong with this way of merging hashes:
use warnings; use strict; use Data::Dumper; my %BB_ENV = (zzz => 555); %ENV = { %ENV, %BB_ENV }; print Dumper(\%ENV); __END__ Reference found where even-sized list expected at $VAR1 = { 'HASH(0x6f45f0)' => undef };
diagnostics shows that you should use parens () instead of curlies {}.