title: Using Perl Hash to populate a drop-down list?
body: <p><em>Newbie Alert</em>  I want to basically read in a few files to get some data out of it. I want to parse this data into a hash table to eventually generate a bar graph.</p>
  
  <p>Here is the type of file, I am reading in. All the files are much more bigger and have many more entries:</p>
  
  <pre><code>&gt; Name      CPU Time     CPU Load Percentage
  &gt; 
  &gt; -----------------------------------------
  &gt; 
  &gt; System                7962        3.00% 
  &gt; 
  &gt; Adobe Photoshop       6783        0.19% 
  &gt; 
  &gt; MSN Messenger         4490        0.01% 
  &gt; 
  &gt; Google Chrome         8783        0.02% 
  &gt; 
  &gt; Idle                   120       94.00% 
  &gt; 
  &gt; =========================================
  </code></pre>
  
  <p>Here's my relevant code for Perl so far:</p>
  
  <pre><code>#!/usr/bin/perl
  use warnings;
  use Data::Dumper;  
  
  
    #Looping through the end of the file  
    while (&lt;DATA&gt;) 
     {
     #Selecting only the CPU Processes
     if (/(.*?)\s+\d+\s+(\d+\.\d+)\%/){
     #Populating the hash with only Process name and % (eg: Idle 94.00%)
      $cpu_util{ $1 } = $2;
      }
     }
  
    #Assigning the axis labels to be pushed onto the graph
    @xvalues = keys %cpu_util;
    @yvalues = values %cpu_util;  
  
        }
  </code></pre>
  
  <hr>
  
  <p>Now, I am able to successfully prase data from multiple files and be able to display a single graph. However, what I'd like to be able to do is, inaddition to displaying just one graph. Provide the user to select which process their interested in and then create a line graph of those points.</p>
  
  <p>However, I'm not completely sure how to go about this. I know all my proccesses are stored in my hash via key/value pairs. So ("Idle -> 94%") etc. What I'd like to end up doing is show a user, a drop down box ... and it lists all the keys in the hash. When the user selected a specific key, it generates a GD::Graph for him. I guess, I will generate the graphs for each key before hand itself and save them as images. Selecting a specific option merely links them to the right image ...</p>
  
  <p>I've been doing some reading online regarding implementing a drop down list using CGI but I haven't gotten too far. I'm thinking of creating another HTML page with the drop-list, but I'm not sure how to get the values to populate dynamicly from the hash stored in Perl ..</p>