sulfericacid has asked for the wisdom of the Perl Monks concerning the following question:
This is the main question I was wondering about when this project started.. I'm trying to do a s/// with two arrays, substitute @first_half with @second_half. The arrays are setup in such a way where $first_half[0] is to be replaced with $second_half[0] and so on-- so the array indexes are aligned perfectly.
Any help would be very appreciated and out of curiousity, have any of you done something like this before or is this a rather silly way to do it?open(FILE, "file.txt") or die "Oops:$!"; my $contents = <FILE>; while (<FILE>) { do every possible s/// with the two arrays here }
Thank you wise monks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: s/// with 2 arrays
by Paladin (Vicar) on Jun 07, 2004 at 16:08 UTC | |
|
Re: s/// with 2 arrays
by davido (Cardinal) on Jun 07, 2004 at 16:09 UTC |