Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Parse::RecDescent - specifying dynamic subrule repetition

by Yary (Pilgrim)
on Feb 19, 2013 at 04:14 UTC ( #1019435=note: print w/replies, xml ) Need Help??


in reply to Parse::RecDescent - specifying dynamic subrule repetition

Like the other people answering, I'm also wondering "how about reaching for unpack, or substr?" Is this part of a larger grammar?

Perhaps you want to parse string-within-a-string into a nested data structure, which would justify a parser. If that's the case, the String rule should have a recursive alternate. If you just want the outer string, copying literally any inner string without interpretation, then you need a dynamic rule that uses $item{Count} to eat exactly that many characters.

  • Comment on Re: Parse::RecDescent - specifying dynamic subrule repetition

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019435]
help
Chatterbox?
[Cosmic37]: I'm wondering whether there is a specific/(or at least "usual") command or does one take a copy before undefining and then copy it back after slurping file into a string?
[BarApp]: I need help accessing perl files. I need permission!!!
[Cosmic37]: I wish thee a peachy life and express gratitude for considering my pathetic questions
[erix]: record separator
[Cosmic37]: Permissions are interesting earthlings. Did nature determine who gives permission and who asks permission. Who was the first to get permission? Are you not related to them as one big earthling family?
[karlgoethebier]: Cojones! We need cojones!
[karlgoethebier]: Ouch! Permissions! We need permissions!

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2017-06-29 16:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (672 votes). Check out past polls.