title: Perl- Dereferencing an arrayref and assigning the result to a variable results in variable having the value 1
body: <p>I am trying to parse a log line which comes in to my script as an array reference.</p>
  
  <p>I have another subroutine to which this log line is passed to extract a certain value, however the function does not seem to receive the log line and instead gets the value 1. This happens when I try to dereference the array ref and assign it to a scalar as well.</p>
  
  <p>The log line looks like -</p>
  
  <pre><code>print Dumper ($logline)
  
  $VAR1 = '2013-06-07 17:22:32.219 &lt;TID 1B344&gt; [uss_smm.reqserv] 162.34.22.1: "POST /ts/start/67257-v/827987/ts/june7test1/backup/20130fd83788-02-ts&amp;action=setarchiver&amp;timestamp=1370625752.172546&amp;as=new2 HTTP/1.1" 200 - Success.';
  
  Assigning the dereferenced value to scalar -
  my $temp_line = @{ $logline };
  print "temp_line is $temp_line \n";
  
  temp_line is 1
  </code></pre>
  
  <p>The subroutine call is  - </p>
  
  <pre><code>my $arch = parse_Smmlog_Arch_Comm(@{ $logline }); 
  </code></pre>
  
  <p>The subroutine for parsing is -</p>
  
  <pre><code>sub parse_Smmlog_Arch_Comm($){
      my $logline = shift;
      print Dumper ($logline);
      test_log(INFO,"in parse_Smmlog_Arch(), logline is  - $logline ");
      my @arr = split('&amp;as=',$logline);
      my @sec_arr = split(' ',$arr[1]);
      return $sec_arr[0];
  }
  </code></pre>
  
  <p>I get this upon running the script, which is because the subroutine doesn't receive the log line.</p>
  
  <pre><code>Use of uninitialized value in split at /Users/myname/parseLog.pl
  </code></pre>
  
  <p>I would appreciate any help on this.</p>