Hi,
I use the following code to open a text file and update any strings such as "apple" to orange".
snippet:
open (IN,"c:\\data"
@lines = <IN>;
close IN;
@lines = map { s/\b$old_hostname\b/$new_hostname/sgi; $_ } @lines;
open (OUT,">c:\\data" || "can't open data :$! ";
print OUT @lines;
But now I must change any words such as "data/applered" or "new_apple_dark" to " data/orangered" "new_orange_dark".
How can I alter my substitution to make it work.
--thanks kirk
I use the following code to open a text file and update any strings such as "apple" to orange".
snippet:
open (IN,"c:\\data"
@lines = <IN>;
close IN;
@lines = map { s/\b$old_hostname\b/$new_hostname/sgi; $_ } @lines;
open (OUT,">c:\\data" || "can't open data :$! ";
print OUT @lines;
But now I must change any words such as "data/applered" or "new_apple_dark" to " data/orangered" "new_orange_dark".
How can I alter my substitution to make it work.
--thanks kirk