Hello Monks,
When compile my perl program, I got an error as 'Memory Stack overflow'. Pls help me to correct this problem.
Please find my codings
My perl code:-- $file=~s#<tbody>((?:[^<]+|<(?!/?tbody>))+</tbody>(?:\s*<tbody>(?:[^<]+ +|<(?!/?tbody>))+</tbody>)*)#"<tbody>\n".${TableBody(\$1)}."\n</tbody> +"#gies; sub TableBody { my ($line) = @_; $temp = "$$line"; $temp =~s#</tbody>$##; $temp =~s#\t#</para></entry><entry><para>#g; $temp ="<row><entry><para>$temp</para></entry></row>"; $temp =~s#<tbody>#<row><entry><para>#g; $temp =~s#</tbody>#</para></entry></row>#g; return \$temp; } My input is:-- <tbody>one two three</tbody> <tbody>one two three</tbody> <tbody>one two three</tbody> <tbody>one two three</tbody> My output is:-- <tbody> <row><entry><para>one</para></entry><entry><para>two</para></entry><en +try><para>three</para></entry></row> <row><entry><para>one</para></entry><entry><para>two</para></entry><en +try><para>three</para></entry></row> <row><entry><para>one</para></entry><entry><para>two</para></entry><en +try><para>three</para></entry></row> <row><entry><para>one</para></entry><entry><para>two</para></entry><en +try><para>three</para></entry></row> </tbody>
It works well. But if the number of rows in the input exceeds 25, the "Memory stack overflow" error comes.
Pls help me, how to increase stack memory.
thanks
In reply to Stack overflow while performing nested substitutions by sivaramanm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |