http://qs1969.pair.com?node_id=446770


in reply to replace a line when regex match...

A solution.
$_ = "host-abc:/var/log/messages::::read_intr"; if (/host-abc.*messages/) { $_ = "new string"; }
Is that what you're looking for?