title: How do I parse or print data after matching a particular line in Perl?
body: <p>i have file with dat as below</p>
  
  <pre><code>      extern const
        extern const
  
       /*****************************************************************************
        *                Data                                         *
        *****************************************************************************/
       #ifdef SELECTED
       /*****************************************************************************
        *                  comments                                         *
        *****************************************************************************/
  
        int test_data1_value;
        int test_data2_value;
        int test_data3_value;
        int test_data4_value;
  
  
       #endif
        random data
        random data
  
      /**********************************************************************
      *                       definitions                     *
      **********************************************************************/
      #define
      #define
  </code></pre>
  
  <p>i need to extract the data line starting with "uint8" between to comments "test data buffer" and "receive signal definations"<br>
  how can this be done i have written a script like</p>
  
  <pre><code>   while (&lt;DATA&gt;) {
     chomp;
     if (/^\*\s* Data / ... /^\*\s*definitions/) {
      if (m/^\s*int/) {
         print "$_";
  
           }
        }
       }
  </code></pre>
  
  <p>i need out put to be as</p>
  
  <pre><code>      int test_data1_value;
        int test_data2_value;
        int test_data3_value;
        int test_data4_value;
  </code></pre>
  
  <p>after matching particular comment string it should check for line starting with int and print that whole line . if there is no int at the beginning of line it should exclude that particular line . but this code is not working for me </p>