open( E, ">", "check-env-$$.txt" ); # adjust path to suit your taste print E "$_ => $ENV{$_}\n" for ( sort keys %ENV ); close E;