in reply to Re: Re: Can I copy a file and rename the file to many new files?
in thread Can I copy a file and rename the file to many new files?
This will replace ALL occurances of HOST and IP in your mainfile.txt.... foreach my $txt (@lines) { # replace HOST and IP with $hostname and $ipaddr $txt =~ s/HOST/$hostname/g; $txt =~ s/IP/$ipaddr/g; print $output "$txt\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Can I copy a file and rename the file to many new files?
by Anonymous Monk on Sep 29, 2003 at 17:36 UTC | |
|
Re: Re: Re: Re: Can I copy a file and rename the file to many new files?
by Anonymous Monk on Oct 01, 2003 at 14:02 UTC |