As merlyn said, all of your environment variables are stored in the %ENV hash. To list them, just iterate over the members of a hash. Here's how I would do it:
print "List of all environment variables:\n";
while ( my($env_name,$env_value) = each %ENV ) {
print "\t$env_name = $env_value\n";
}