in reply to replace a line when regex match...
A solution.
Is that what you're looking for?$_ = "host-abc:/var/log/messages::::read_intr"; if (/host-abc.*messages/) { $_ = "new string"; }
In Section
Seekers of Perl Wisdom