Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: Matching nested begin/ends

by I0 (Priest)
on Aug 01, 2002 at 00:27 UTC ( #186646=note: print w/replies, xml ) Need Help??

in reply to Matching nested begin/ends

($re=$_)=~s/((begin)|(end)|.)/${['(','']}[!$2]\Q$1\E${[')','']}[!$3]/g +s; $re = join'|',map quotemeta,eval{/$re/}; $re = qr/$re/;

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://186646]
[james28909]: it would be to much work just to get around renaming three subs lol
[james28909]: but you could put it all in one sub and return the same data type that was inputted. i could write a small example maybe
[Lady_Aleena]: Their uses are also vastly different.
[Lady_Aleena]: The first two make hashes and arrays from a file, the third returns data from a pre-existing hash.
[Lady_Aleena]: Well, HoH and AoH respectively.
[Lady_Aleena]: But if you want to play, play. I don't mind. 8)

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2017-05-24 05:06 GMT
Find Nodes?
    Voting Booth?