title: Array return is not working
body: <pre><code>use Text::Diff;
  my $count;
  our $stats2 = 0;
  for($count = 0; $count &lt;= 1000; $count++){
      my $data_dir="archive/oswiostat/oracleapps.*dat";
      my $data_file= `ls -t $data_dir | head -1`;
      chomp($data_file);
      while(defined($data_file)){
          print $data_file;
          open (DAT,$data_file) || die("Could not open file! $!");
          my @stats1 = stat $data_file;
          @raw_data=&lt;DAT&gt;;
          close(DAT);
          print "Stats1 is :$stats1[9]\n";
          sleep(5);
          print "Checking $stats1[9] equals $stats2\n";
          chomp $stats[9];
          chomp $stats2;
          if($stats1[9] != $stats2){
              print "I am here";
              my @diff = diff \@raw_data, \@raw_data2, { STYLE =&gt; "Context" };
              @trim_diff = removedash(@diff);
              print "@trim_diff";
          }
          @raw_data2=@raw_data;
          $stats2 = $stats1[9];
          print "Stat2: $stats2\n";
      }
  }
  
  sub removedash {
      print "Its in sub";
      my $cnt=0;
      foreach (@_) {
          chomp;
          if (/^- /){
              s#^- ##g;
              $ar[$cnt] = "$_\n";
              $cnt++;
          }
      }
      return (@ar);
  }   
  </code></pre>
  
  <p>I am using a sub to remove dashes from array and send it back. The @trim_diff should have the return @ar, but it is showing nothing. I am not sure where i have done wrong. Can you guys help me with it? </p>