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"; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: replace a line when regex match...
by perlknight (Pilgrim) on Apr 12, 2005 at 05:13 UTC | |
by revdiablo (Prior) on Apr 12, 2005 at 05:25 UTC |
In Section
Seekers of Perl Wisdom