in reply to Shift returning pointer

You can use Data::Dumper to look at arbitrarily complex Perl data structures (tip #4 from Basic debugging checklist):
use Data::Dumper; # choose one of these, depending on how you initially declared Envs #print Dumper($Envs); #print Dumper(\@Envs); #print Dumper(\%Envs); print Dumper($environment);