I have this bit of cgi which is meant to replace occurences of 'FLF' followed by two digits (in an html file) with the appropriate fields from an SQL query result ie I get the field contents into an array element then parse the html file to find "FLF/d/d" using a substitution that is
the SQL fetch is like so
while($row = $sth->fetchrow_arrayref) {
$Replacement[12]=$row->[0];
#etc....
#then in the loop still...
$Kine=~s/FLF(\d\d)/$Replacement[$1]/ge;
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?
Hope this is understandable!!
thanks to Stephen and wmono for suggesting using this form.
splendid...
catcher
Edit by dws to close <code> tag and remove entities
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.