title: How to handle below pattern matching in Perl
body: <p>How to do the below mentioned pattern match?  </p>
  
  <p>Below input is in an array:</p>
  
  <pre><code>@array=("gs : asti:34:234", "gs : asti:344:543:wet");
  </code></pre>
  
  <p>I used <code>foreach loop</code> so that I split them and I'm pushing them into an array.  </p>
  
  <p>Help me in resolving the below issue.</p>
  
  <pre><code>foreach(@array)
  {
      if($_ =~ /gs/ig)
      {
  
          my @arr2 = split(":",$_); #Splitting the matched pattern
          push(@y,$arr2[1]);
      }
  }
  </code></pre>
  
  <p>Acutal output is: <code>asti , asti</code><br>
  Desired/Expected Output : <code>asti:34:234 , asti:344:543:wet</code></p>