Remove string from file
perl -ni -e 'print unless /pattern/' /path/to/filename
Replace string with string
perl -p -i -e 's/PATTERN/NEW_ENTRY/g' /path/to/filename
Insert string where delimeter is found
This will replace the original delimiter with the new entry and then add the delimiter so you can use it again in the future.
perl -p -i -e 's/DELIMETER/NEW_ENTRY\n\nDELIMETER/g' /path/to/filename
This will grab anything thats in the standard IPv4 format (anything! not always IPs…but usually).
perl -ne 'print "$&\n" while m#\d+\.\d+\.\d+\.\d+#g' file.txt
Search for and find whole paragraphs containing $string
perl -00ne "print if /$string/i" < file.txt