On Wed, 2008-12-24 at 21:42 +0530, Amit Saxena wrote:
> However when I try to execute it even with the proper text, I get the
> different output than anticipated.
> 

I'm not surprised that the results are not what you expected.  Capture
variables, $1, $2, $3, ... are globals and cannot be used in recursion.
I am surprised by exactly what was returned; it is not what I expected.

IMHO, recursion in regular expressions (RE) is a Bad Idea.

First, it makes the RE more difficult to understand.  Second, they don't
always work right.

I would keep my REs simple and use Perl code to implement what is
needed.  The demon Murphy is still out to get coders and KISS is the
most effective means to deal with him.


-- 
Just my 0.00000002 million dollars worth,
  Shawn

Believe in the Gods but row away from the rocks.
  -- ancient Hindu proverb


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to