# I've striped down the core dump example, # It no longer core dumps under v5.6.1 but it still returns the wrong +answer # Can anyone explain why /C(2)/ is not getting substituted? use strict; print doFunc( "MAIN", "B(1)+C(2)" ); sub doFunc{ my $theFunc = shift; local $_ = shift; my $re; $re = ${{ "B(1)+C(2)" => '1|2', }}{$_}||quotemeta; print "$theFunc: '$_'=~/$re/\n"; print join"\n",/(\w+)\(($re)\)/g,"\n"; $_ =~ s/(\w+)\(($re)\)/&doFunc($1,$2)/eg; # /ego works /eg fails return "func $theFunc returns <$_>"; } #should return #func MAIN returns <func B returns <1>+func C returns <2>> #
In reply to recursive /eg fails by I0
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |