kirk123 has asked for the wisdom of the Perl Monks concerning the following question:
Hi:
I code like the following but the second (.*) does'nt match the newline. How do I get it to matches everthing including a newline.
--kirkforeach (@lines) { if ( /(.*)$old_hostname(.*)/i ) { $concat = $1 . $new_hostname . $2; s/$_/$concat/g; } open (OUT,">$file"); print OUT @lines; }
Edit by myocom: Added code tags and fixed formatting.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do you match for everything including newline
by fruiture (Curate) on Aug 22, 2002 at 19:28 UTC | |
|
Re: How do you match for everything including newline
by simon.proctor (Vicar) on Aug 22, 2002 at 19:31 UTC |