Dear All,
I am having a file with the below lines
<o><r>R. Demarr, A. Steger, On elements with negative square, Proc.
Amer. Math. Soc. 31 (1) (1972) 57--60.</r></o>
<o><r>C.A. Eschenbach, F. Hall, C.R. Johnson, Z. Li, The graphs of
unambiguous entries in the product of two <m>MATH0810075.dat:1</m>
sign patterns, Linear Algebra Appl. 260 (1997) 95--112.</r></o>
<o><r>C.A. Eschenbach, F. Hall, Z. Li, Sign patterns that allow an
inverse pair <m>MATH0810075.dat:2</m> and
<m>MATH0810075.dat:3</m>, Linear Algebra Appl. 252 (1997)
299--321.</r></o>
I need to replace the content between <m> and </m> with math code from
another file. in this process there are two problems.
Code:
while($line=~m!MATH(\d{7}\.dat):(\d{1,2})!g)
{
$math=&math($1, $2);
$line=~s!MATH$1:$2!$math!;
print $line;
}
The output of the code is like the below:
<o><r>C.A. Eschenbach, F. Hall, C.R. Johnson, Z. Li, The graphs of
unambiguous entries in the product of two <m>(+ , -)</m> sign patterns,
Linear Algebra Appl. 260 (1997) 95--112.</r></o>
<o><r>C.A. Eschenbach, F. Hall, Z. Li, Sign patterns that allow an
inverse pair <m>B</m> and <m>MATH0810075.dat:3</m>, Linear Algebra
Appl. 252 (1997) 299--321.</r></o>
<o><r>C.A. Eschenbach, F. Hall, Z. Li, Sign patterns that allow an
inverse pair <m>B</m> and <m>B^{-1}</m>, Linear Algebra Appl. 252 (1997)
299--321.</r></o>
<o><r>C.A. Eschenbach, Z. Li, How many negative entries can <m>A^2</m>
have?, Linear Algebra Appl. 254 (1997) 99--117.</r></o>
Please help me in knowing the bug in the code and correct it.
Regards,
Ganesh
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>