title: Filter Clearcase message with a Perl regex
body: <pre><code>version "n:\gill_vob\6_coding\src\p_l\p_l_com\p_l_cc\p_l_cc_msg\src\p_l_can_enable_types.h@@\main\b8519781_22.0\task_gv133946\1"
    created 03-Nov-14.21:26:19 by Kumar (qz7vb1.europe_ccusers@DLG9ZMZN1)
    "Updated CAN signal to include object code signals of D0A40"
    Element Protection:
      User : ASIA\INKARBLR_vobadmin : r--
      Group: ASIA\INKARBLR_ccusers : r--
      Other:          : r--
    element type: text_file
    predecessor version: \main\b8519781_22.0\task_gv133946\0
    Hyperlinks:
      Merge@2092361@\gill_vob &lt;- \gill_vob\6_coding\src\p_l\p_l_com\p_l_cc\p_l_cc_msg\src\p_l_can_enable_types.h@@\main\b8519781_24.0\1
  </code></pre>
  
  <p>I have a set of files which contains data like above.
  For the data above, if the word <code>version</code> is detected I want to print the data after <code>Merge@2092361</code>
  i.e </p>
  
  <pre><code>\gill_vob\6_coding\src\p_l\p_l_com\p_l_cc\p_l_cc_msg\src\p_l_can_enable_types.h@@\main\b8519781_24.0\1
  </code></pre>
  
  <p>using Perl's regex.</p>
  
  <p>Below is the code i have been trying :</p>
  
  <pre><code>my $dir = "C:\\Perl_Play\\label";
  
  find(\&amp;label_checks,$dir);
  
  sub  label_checks
  {
  
  $file =  "$File::Find::name\n";
  
  open FILE, $file;
  
  while(&lt;FILE&gt;)
  {
  $filename = $_;
  
  if(($filename =~ /^version\s/)||($filename =~ /^directory\sversion\s/))
  {
  if($filename =~ /(")(.*)(")/)
  {
  print "$2\n";
  
  if($filename =~ /Merge/)
  {
  print "$filename\n";
  print "hello";
  }
  }
  
  }
  }
  }
  </code></pre>
  
  <p>The problem with above code is that its not able to the contents after " Merge@2092361@\gill_vob &lt;-".
  It is able to identify "version" and print contents after that but its not able to print the lines after  "Merge@2092361@\gill_vob &lt;-".</p>
  
  <p>The below code worked for me:</p>
  
  <pre><code>while(&lt;FILE&gt;)
  
  {
  $filename = $_;
  
  
  if(($filename =~ /^version\s/)||($filename =~ /^directory\sversion\s/))
  {
  if($filename =~ /(")(.*)(")/)
  {
  
  print "$2\n";
  
  }    
  
  }
  if($filename =~ /(s*)Merge@(\d*)@\\(\w+_\w+)(\s*)-&gt;(\s*)/)
  {
  print "Merged to $'\n";
  }
  
  }
  }
  </code></pre>
  
  <p>Thank you</p>