catcher has asked for the wisdom of the Perl Monks concerning the following question:
I thought this would replace occurences of 'FLF' followed by two digits with the value of the array element with that index, ie FLF12 becomes value of $Replacement[12] , however it does this but only uses the first value of $row-> [0] and doesn't provide the other row data for all the other rows following, but if you print the value of $row->[0] at that point in the code it is fine (ie contains the data from each successive row no problem?while($row = $sth->fetchrow_arrayref) { $Replacement[12]=$row->[0]; #etc.... #then in the loop still... $Kine=~s/FLF(\d\d)/$Replacement[$1]/ge;
Edit by dws to close <code> tag and remove entities
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl SQL substitution pain!
by stephen (Priest) on Apr 08, 2002 at 00:24 UTC | |
|
Re: Perl SQL substitution pain!
by JayBonci (Curate) on Apr 08, 2002 at 09:32 UTC |