Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- PERL 4.0 Reference Guide - Norton Guide http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]

     keys(ASSOC_ARRAY)

     keys ASSOC_ARRAY

             Returns a normal array consisting of all the keys of
             the  named associative array.  The keys are returned
             in an apparently random order, but it  is  the  same
             order as either the values() or each() function pro-
             duces (given that the associative array has not been
             modified).   Here  is  yet another way to print your
             environment:

                  @keys = keys %ENV;
                  @values = values %ENV;
                  while ($#keys >= 0) {
                       print pop(@keys), '=', pop(@values), "\n";
                  }

             or how about sorted by key:

                  foreach $key (sort(keys %ENV)) {
                       print $key, '=', $ENV{$key}, "\n";
                  }

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson