In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/6cf7238579bd512306a71f8d84f26589241691ff?hp=43269761c362a1ad9ab57c5513879796142282fa>
- Log ----------------------------------------------------------------- commit 6cf7238579bd512306a71f8d84f26589241691ff Author: Zefram <[email protected]> Date: Fri Oct 23 11:13:21 2009 +0200 a2p match() faulty While I was doing the $[ thing, I discovered a bug in a2p's handling of the match() operator. It uses a comma operator, which has unintended behaviour in list context (e.g., in a print statement). It also returns empty string for a non-match, rather than the required 0. ----------------------------------------------------------------------- Summary of changes: x2p/walk.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/x2p/walk.c b/x2p/walk.c index 2890375..86419c1 100644 --- a/x2p/walk.c +++ b/x2p/walk.c @@ -725,7 +725,7 @@ sub Pick {\n\ str_cat(str," =~ "); str_scat(str,fstr=walk(1,level,ops[node+2].ival,&numarg,P_MATCH+1)); str_free(fstr); - str_cat(str," && ($RLENGTH = length($&), $RSTART = length($`)+1)"); + str_cat(str," ? scalar($RLENGTH = length($&), $RSTART = length($`)+1) : 0"); numeric = 1; break; case OUSERDEF: -- Perl5 Master Repository
