while () { /\d\s+(.*?)\s+seconds$/i && print "Test Data: $1\n"; } __DATA__ 192.168.1.1 seconds 192.168.1.1 links.html links, index.html index 10 seconds 192.168.1.1 article1.html art1, article2.html art2, adpage 200 seconds #### while () { next unless /START/ .. /END/; print $_; } __DATA__ asdf START 1 2 3 END asdf