Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: Re: System Variables

by archen (Pilgrim)
on Oct 09, 2002 at 23:33 UTC ( #204065=note: print w/replies, xml ) Need Help??

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'


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://204065]
[jdporter]: but I'd like to let the user specify it as individual bits, i.e. 0b0000000100000001
[jdporter]: there is no bit/binary equivalent of hex, right?
[jdporter]: I guess that the most direct way of doing it is with some magical incantation involving unpack or whatever
[jdporter]: let me google that for me ;-)
[jdporter]: hex points explicitly to oct, which does the job. :-D
[jdporter]: omg, I f love Perl!
[choroba]: say unpack 'H*', pack 'B*', $mask =~ /0b([01]+)/;
[choroba]: use C instead of H to get the decimal number

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (11)
As of 2018-02-20 16:32 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (272 votes). Check out past polls.