in reply to Optimum method to perform data extraction in a table

Is there a more optimized way to achieve the same ?

Yes, there is. See Range Operators:

foreach (@out_arr){ if (/.*?10.72.184.159:disk_data_written.*/ .. /^\s*$/){ push @ts_arr, $_; } }