title: grepping command line arguments out of an array in perl
body: <p>I have a file that looks like this:</p>
  
  <pre><code>[options42BuySide]
  logged-check-times=06:01:00
  logged-check-address=192.168.3.4
  logged-check-reply=192.168.2.5
  logged-check-vac-days=sat,sun
  start-time=06:01:00
  stop-time=19:00:00
  falldown=logwrite after 10000
  failtolog=logwrite after 10000
  listento=all
  global-search-text=Target Down. This message is stored;
  
  [stock42BuySide]
  logged-check-times=06:01:00
  logged-check-address=192.168.2.13
  logged-check-reply=192.168.2.54
  logged-check-vac-days=sat,sun
  start-time=06:01:00
  stop-time=18:00:00
  </code></pre>
  
  <p>The script grinds the list down to just the name, start and stop time. </p>
  
  <pre><code>sellSide40, start-time=07:05:00, stop-time=17:59:00
  SellSide42, start-time=07:06:00, stop-time=17:29:00
  SellSide44, start-time=07:31:00, stop-time=16:55:00
  42SellSide, start-time=09:01:00, stop-time=16:59:00
  </code></pre>
  
  <p>The problem is that I would like to filter out specific names from the file with comand line parameters. 
  I am trying to use the @ARGV array and grep the command line values out of the @nametimes array. Something like : </p>
  
  <pre><code>capser@capser$ ./get_start_stop SorosSellSide42 ETFBuySide42
  </code></pre>
  
  <p>The script works fine for parsing the file - I just need help on the command line array</p>
  
  <pre><code>#!/usr/bin/perl
  use strict ;
  use warnings ;
  
  my ($name , $start, $stop, $specific);
  my @nametimes; 
  my $inifile = "/var/log/Alert.ini";
  open ( my $FILE, '&lt;', "$inifile") or die ("could not open the file -- $!");
     while(&lt;$FILE&gt;) {
        chomp ;
        if (/\[(\w+)\]/) {
            $name = $1;
  
        } elsif (/(start-time=\d+:\d+:\d+)/) {
            $start = $1;
  
        } elsif  (/(stop-time=\d+:\d+:\d+)/) {
            $stop = $1;
            push (@nametimes, "$name, $start, $stop");
        }
     }
  
  for ($a = 0; $a &gt;= $#ARGV ; $a++) {
  $specific = (grep /$ARGV[$a]/, @nametimes) ;
  print "$specific\n";
  }
  </code></pre>
  
  <p>It is probably pretty easy - however I have worked on it for days, and I am the only guy that uses perl in this shop. I don't have anyone to ask and the googlize is not panning out.  I apologize in advance for angering the perl deities who are sure to yell at me for asking such and easy question. </p>