title: perl - extract only from function definitions and not from function declarations
body: <p>FILE CONTAINS FUNCTION DEFINITIONS AND FUNCTION DECLARATIONS</p>
  
  <pre><code>eErrorT ChainCtrlUpdateCameraRoute(ChainCtrlT* pChainCtrl, RouteListItemT* pNewRoute, RouteListItemT* pCurrRoute);
  
  eErrorT ChainCtrlSetJpgSnapshotFile(ChainCtrlT* pChainCtrl, RouteListItemT* pRoute, char * dst_chain, char *jpg_file_path)
  {
  
  } 
  </code></pre>
  
  <p>MY CODE</p>
  
  <pre><code>use strict;
  use warnings;
  use vars qw(@temp $index $i);
  
  open(my $FILE, "&lt; a.c") or die $!;
  my @arr = &lt;$FILE&gt;;
  foreach(@arr){  
     if($_ =~ /^ \S+ \s+ \S+ \s* \( (.+?) \) /xsmg) {    # extracts function arguments
        my $arg = $1;
        my @arr = map /(\w+)$/, split /\W*?,\W*/, $arg;
        print @temp = map "$_\n", @arr;
       }
  } 
  </code></pre>
  
  <p>GIVES OUTPUT</p>
  
  <pre><code>pChainCtrl
  pNewRoute
  pCurrRoute
  pChainCtrl
  pRoute
  dst_chain
  jpg_file_path
  </code></pre>
  
  <p>OUTPUT NEEDED</p>
  
  <pre><code>pChainCtrl
  pRoute
  dst_chain
  jpg_file_path
  </code></pre>
  
  <p>I need to extract arguments only from function definition(ChainCtrlSetJpgSnapshotFile) and not declaration(ChainCtrlUpdateCameraRoute).</p>
  
  <p>I need to look whether the line with (..) doesn't have ";" in the same line. but I am unable to get regex command for it </p>