use strict; use warnings; use diagnostics; while ( my($key, $value) = each %ENV) { print "Key: $key\tValue: $value\n"; }