only undef env proxy if it exists

Use of uninitialized value in scalar assignment at...