maha has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks
i ve a problem in executing loop,i want to close the body tag before the reference or notes,or acknowledgement,if three statement will not present , the loop should close the body tag at the of chapter
the below code close the tag but the problem is , if the three statement present at a in a chapter mean it should close the body tag which statement come first.
The three statement may come in any order,my code put the tag before the reference statement because i put reference at the first position of the loop
References|Note|Acknowledgement,Note|References|Acknowledgementif($line =~ /<P_sec\d>(?:<\w>)?(<xref ref-type="page" id="page_\d+"\/> +)?(?:<\w>)?(References|Note|Acknowledgement)(?:<\/\w>)?<\/P_sec\d>/<\ +/body>\n$&/si) { } else{ $line .= "</body>\n"; }
pls give me a suggestion to solve my problem,thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: detection in Loop condition
by Marshall (Canon) on Jan 21, 2012 at 06:26 UTC | |
|
Re: detection in Loop condition
by Anonymous Monk on Jan 21, 2012 at 04:42 UTC | |
by maha (Novice) on Jan 21, 2012 at 04:57 UTC | |
by CountZero (Bishop) on Jan 21, 2012 at 08:22 UTC | |
by Anonymous Monk on Jan 21, 2012 at 09:14 UTC |