in reply to recursive parsing techniques
This is trivial for recursive parsing, I know, but it makes the point: you've got to call the routine when you come to an '(', and you've got to exit when you come to an ')'. Not doing either of those will most likely result in hangs and/or rubbish. I know, I've tried. In the case you're showing, looks to me like you want to recurse (call the routine you're in) on "BEGIN:VCARD" and return on "END:VCARD". What that ends up meaning is that you write the routine to parse one VCARD, and to add that one to the hash. Oh, yeah, and you may want to verify that your data is healthy, so there are as many ENDs as BEGINs. Remember, "To iterate is human, to recurse divine."a * (b - d + (e / f) - 7) + 3
|
|---|