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.
In reply to How do you match for everything including newline by kirk123
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |