http://www.perlmonks.org?node_id=167187

I0 has asked for the wisdom of the Perl Monks concerning the following question:

At least it does in perl, v5.6.1 built for IP32-irix and perl, v5.6.0 built for IP22-irix Anyone know if it's fixed in v5.8?
#!/usr/bin/perl -w use strict; print doFunc( "AABBCC",0 ); print doFunc( "AAAABBBBCCCC",0 ); sub doFunc { my( $theParam,$depth) = @_; print STDERR "dofunc($theParam)\n"; my $re; $re = ${['(.+)\1']}[$depth]||'(.+)(\1)'; print STDERR join"\n", $theParam =~ /$re/g,''; $theParam =~ s/$re/&doFunc($1,$depth+1)/ge; ++$theParam; print STDERR "=$theParam\n"; return $theParam; }