use strict; use warnings; #### foreach(@sof_i) { last if $_=~/^={30}/; ($i_day, $i_month, $i_date, $i_hour, $i_minute, $i_second, $i_ +year)=$_=~/(^\D{3}) (\D{3})\s+(\d{1,2}) (\d{2}):(\d{2}):(\d{2}) (\d{4 +}) sw_eof \[.+\] try / if $_=~m/try/; ($i_con_day, $i_con_month, $i_con_date, $i_con_hour, $i_con_mi +nute, $i_con_second, $i_con_year)=$_=~/(^\D{3}) (\D{3})\s+(\d{1,2}) ( +\d{2}):(\d{2}):(\d{2}) (\d{4}) sw_eof \[.+\]/ if $_=~m/connected/; ($i_socket_status)=$_=~/\[(.*)\]/ if $_=~m/EOF Socket Status/; $sof_to_delete++ } ##This just randomly deletes the first elements of the array for however many times you did $sof_to_delete++ for ($i=0;$sof_to_delete>0;$sof_to_delete--) {shift(@sof_i);} #### foreach(@sof_i) { $sof_to_delete++; } shift @sof_i for (0..$sof_to_delete)