Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by Krambambuli (Curate)
on Sep 02, 2016 at 09:00 UTC ( [id://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 (Hermit) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1171038]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2024-04-23 21:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found