$logline
is not an array reference, it is a plain string.
However, you are treating it as an array reference, so it looks for an array variable like this:
@{'2013-06-07 17:22:32.219 <TID 1B344> [uss_smm.reqserv] 162.34.22.1: "POST /ts/start/500000-b/500000/ts/june7test1/backup/20130607T102446-02-ts&action=setarchiver×tamp=1370625752.172546&as=new2 HTTP/1.1" 200 - Success.'}
which would have failed under use strict
(which keeps you from accidentally using symbolic references like this). You should enable use strict;
and use warnings;
in all your code to catch many simple errors.
Even if it had been an array reference, this code:
my $temp_line = @{ $logline };
assigns the number of elements in the array to $temp_line
; because you are getting 1, you are accidentally using the same symbolic reference somewhere else as well and actually creating and populating the array with the bizarre name.
To get the first element of an array, do:
${ $logline }[0]
or to get it while removing it from the array, do:
shift @{ $logline }
In general, using references is only slightly more complicated than using simple arrays or hashes; see http://perlmonks.org/?node=References+quick+reference for some easy to remember rules to help.