monger has asked for the wisdom of the Perl Monks concerning the following question:
The results of this have been nothing. If I put parentheses aroung the variables in the s///g regex, I end up with an ever growing file. The end result we want to have is a copy of the orig PIX config with all the IPs substituted with FQDNs. Thanks, Mongeropen INFILE, "longwood.pix"; open FQDN, ">fqdn.pix" or die "Can't open der finalen filen: $!"; @final = <INFILE>; close INFILE; while ( ($ip, $a) = each (%hosts)) { foreach $line (@final) { 's/$ip/$a/g'; print FQDN @final; } } close INFILE; close FQDN;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Search and replace in an array using data in hash
by Abigail-II (Bishop) on Aug 08, 2003 at 15:10 UTC | |
by halley (Prior) on Aug 08, 2003 at 15:28 UTC | |
by Abigail-II (Bishop) on Aug 08, 2003 at 15:39 UTC | |
|
Re: Search and replace in an array using data in hash
by Zaxo (Archbishop) on Aug 08, 2003 at 15:32 UTC | |
by monger (Friar) on Aug 08, 2003 at 18:13 UTC | |
by shenme (Priest) on Aug 09, 2003 at 09:09 UTC | |
by Zaxo (Archbishop) on Aug 08, 2003 at 21:24 UTC |