$result = Result from a LWP request while (my @Line = ($result->content =~ /^((?:\d+\.){3}\d+)\s+((?:\d+\.){3}\d+)\s+(\d+)\s+(\d+)\s+(\*|[\w\.-]+\@[\w\.-]+\.[\w]+)\s+(\*|[\w\.-]+\@[\w\.-]+\.[\w]+)$/mg)) { my ($SrcIP,$DstIP,$Bytes,$Packets,$SrcUser,$DstUser) = @Line; # Do stuff here (ie, insert into mysql) }