title: How foreach loop in perl works with arrays in perl
body: <p>this program should execute three times but is executing only twice.
  Can anyone explain how this foreach loop will work in perl.</p>
  
  <pre><code>#!/usr/bin/perl
  use strict;
  use warnings;
  my @arr=("sandeepr", "vijay","vikas");
  for my $i( @arr)
  {
      print @arr;
      my $b=pop(@arr);
      print "\n $b";
  }
  </code></pre>