#!/usr/bin/perl -w # Access environment variables. @key_names = keys(%ENV); print "Key names are: @key_names\n\n"; # Now, access each element from the list. foreach $key (@key_names) { print "$key=$ENV{$key}\n"; }