http://www.perlmonks.org?node_id=204065


in reply to Re: System Variables
in thread System Variables

might be a little more informative if you do something such as:
foreach( keys %ENV ) { print "$_ = $ENV{$_} \n"; }
Since what varables are available may vary from system to system. Of course just wanting to know "system variables" is sort of a vague question...

Replies are listed 'Best First'.
Re^3: System Variables
by Aristotle (Chancellor) on Oct 10, 2002 at 00:01 UTC
    Or perhaps more economically,
    while(my ($key, $val) = each %ENV) { print "$key = $val\n"; }
    since you're not sorting the keys anyway.

    Makeshifts last the longest.

      I'm just feeling a bit silly...
      perl -e'print$_,$|--?$/:qq?$"=$"?for%ENV'

      -Blake