Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Weirdness (duplicated data) while building result during parsing using regex

by Krambambuli (Curate)
on Sep 02, 2016 at 09:00 UTC ( #1171038=note: print w/replies, xml ) Need Help??


in reply to Weirdness (duplicated data) while building result during parsing using regex

If you add an 'use Data::Dump' to your module and insert lines like
print "4 \$_: '$_'\n", "\$^N: ", dd( $^N ), "\$^R: ", dd( $^R );
after your 'push' instructions, there is clearly a difference in behavior between your example cases.

Maybe you can figure it out from there?
  • Comment on Re: Weirdness (duplicated data) while building result during parsing using regex
  • Download Code

Replies are listed 'Best First'.
Re^2: Weirdness (duplicated data) while building result during parsing using regex
by perlancar (Pilgrim) on Sep 02, 2016 at 10:09 UTC
    Thanks for the suggestion, I indeed forgot to try "print"-debugging at every step. Apparently there's a backtracking involved in the case of [attr() eq 1] but not in the case of [attr()=1]. I should've been suspicious of backtracking whenever some kind of "duplication" happens. Will debug this further.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1171038]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2019-11-13 20:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (74 votes). Check out past polls.

    Notices?