Hello again

Not too sure how to pose this question, but here goes.

Working on an html page.
There are many blocks of code placed between <tr> and </tr> in the page.

The block(s) I am playing with have seven lines of code placed between <tr> and </tr>, (repeated a number of times throughout the page) but which have specific differences to all the other blocks. The first being, each line in this block contains the word scope. The second being, none of the other blocks contain any of the following data between ">" and "<"
line 1 contains >one<
line 2 contains >two<
line 3 contains >three<
line 4 contains >one<
line 5 contains >one<
line 6 contains >six<
line 7 contains >seven<

Using a method along the lines of the example given below, how would I (test and) replace only in this block? (obviously, the following example changes every single instance, so I know it is totally wrong for the task).

open( F, $ARGV[0] );
while( <F> ) {
 s!>one<!>two<!;      # line 1
 s!>two<!>three<!;    # line 2
 s!>three<!>four<!;   # line 3
 s!>one<!>two<!;      # line 4
 s!>one<!>five<!;      # line 5
 s!>six<!>twelve<!;   # line 6
 s!>seven<!>eight<!;  # line 7
{
  print;
 }
}

I can paste a copy of the actual block of code if needed.

thanks
Brian

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to