I want put a variable in a array and take this array by a variable $splited_line[0]
My script is:
#!/usr/bin/perl
use DBI;
use Data::Dumper;
use DBD::mysql;
use POSIX;
#use strict; use warnings;
#"titi.log" or die $!;
open(FILE,"<file.log");
print "file loaded \n";
my @lines=<FILE>;
#tout les valeurs du fichier se trouve dans le tableau lines
close(FILE);
my @temp_arr;
foreach my $line(@lines)
{
@temp_arr=split('\s',$line);
#converti en nombre
$temp_arr[12] =~ s/[^\d.]//g;
#converti en entier
$temp_arr[12] = floor($temp_arr[12]);
#enlève les simple cote
$temp_arr[10] =~ s/^'|'$//g;
if ($temp_arr[12] > 5)
{
if ($temp_arr[1] eq "Jan")
{
$temp_arr[1] = "01"
}
if ($temp_arr[1] eq "Feb")
{
$temp_arr[1] = "02"
}
if ($temp_arr[1] eq "Mar")
{
$temp_arr[1] = "03"
}
if ($temp_arr[1] eq "Apr")
{
$temp_arr[1] = "04"
}
if ($temp_arr[1] eq "May")
{
$temp_arr[1] = "05"
}
if ($temp_arr[1] eq "Jun")
{
$temp_arr[1] = "06"
}
if ($temp_arr[1] eq "Jul")
{
$temp_arr[1] = "07"
}
if ($temp_arr[1] eq "Aug")
{
$temp_arr[1] = "08"
}
if ($temp_arr[1] eq "Sep")
{
$temp_arr[1] = "09"
}
if ($temp_arr[1] eq "Oct")
{
$temp_arr[1] = "10"
}
if ($temp_arr[1] eq "Nov")
{
$temp_arr[1] = "11"
}
if ($temp_arr[1] eq "Dec")
{
$temp_arr[1] = "12"
}
$temp_splited_line = "$temp_arr[4]-$temp_arr[1]-$temp_arr[2] $temp_arr[3] $temp_arr[10] $temp_arr[12]";
my @splited_line = $temp_splited_line;
#my @temp_array = split(' ', $line)
$temp_arr[3] $temp_arr[10] $temp_arr[12];
#2017-07-13 21:34:30 SG_PICK_BOL 5.428
#$slow_trans_line = "$word5-$word2-$word3 $word4 $word11 $word13";
#print "$slow_trans_line\n";
}
}
print "$splited_line[0]\n";
I want a line not a word in the output value print "$splited_line[0]\n";.