IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Ah
So for you the old-style plists are your One True Data Format for data interchange.

In the Perl world there is no such thing - largely because a lot of Perl exists in the boundaries of converting between different people's home-grown data formats. You aren't going to figure out how to deal with those without doing I/O.

However a million and one attempted universal formats have been produced. The ones that seem to have mindshare in the Perl world are XML, YAML, and native Perl code. Each of which has Perl tools that keep you from having to think about I/O. I don't think that another would get mindshare, but there is no harm in throwing it out there.

Incidentally for writing recursive descent parsers, the gold standard in Perl seems to be [link|http://search.cpan.org/~dconway/Parse-RecDescent-1.94/lib/Parse/RecDescent.pod|Parse::RecDescent]. Unfortunately since it was added, Perl added the /g attribute to REs but the module has never been rewritten to use that. (Damian intended to, but never got around to it in Perl 5. His rewrite will be built into the language in Perl 6.) So its memory use tends to be quadratic in the size of the string, and performance on long strings is correspondingly bad.

If you write a recursive descent parser in Perl, my suggestion is therefore either to use that, or to study the pos function and use REs with \\G and /gc liberally in your tokenizing. Oh, and never, ever use $`, $& or $'. (Use once and the RE engine slows down a lot, permanently.)

Cheers,
Ben
About the use of language: it is impossible to sharpen a pencil with a blunt axe. It is equally vain to try to do it with ten blunt axes instead. -- Edsgar W. Dijkstra
New One True Data Format
Lets just say I've got a lot of them around, plenty of code for dealing with them, and I can read/write/edit them by hand easily.




That was lovely cheese.

     --Wallace, The Wrong Trousers
Expand Edited by tuberculosis Aug. 21, 2007, 06:40:37 AM EDT
     Perl - storing a hash in a file to re-read later - (tuberculosis) - (26)
         Wouldn't it be better to build it as you read? - (drewk) - (2)
             Its not large - its small - (tuberculosis) - (1)
                 Perl is line oriented by default - (broomberg)
         This wheel has been invented already :-) - (ben_tilly) - (22)
             <fawn>Wonderful post</fawn> - (pwhysall) - (1)
                 <preen /> -NT - (ben_tilly)
             I am so glad I gave up on tying my programming skills... - (inthane-chan) - (7)
                 Why? -NT - (deSitter) - (6)
                     Because there's no way I could match that answer. -NT - (inthane-chan) - (5)
                         But that isn't programming - (ben_tilly) - (4)
                             Nice to see a teacher/craftsman in action. - (ChrisR) - (3)
                                 A good thing for my spare time you mean? - (ben_tilly)
                                 Why? -NT - (deSitter) - (1)
                                     Jack of all languages... - (ChrisR)
             I figured it had - one more quickie question - (tuberculosis) - (11)
                 Error checking remains a best practice - (ben_tilly) - (10)
                     Agree - (tuberculosis) - (9)
                         You lucky duck. - (FuManChu)
                         What do you mean by plists? - (ben_tilly) - (6)
                             I meant NextStep style plists - (tuberculosis) - (5)
                                 Do you mean kind of like this? - (ben_tilly) - (3)
                                     Pretty close - (tuberculosis) - (2)
                                         Ah - (ben_tilly) - (1)
                                             One True Data Format - (tuberculosis)
                                 Big River Books - rofl - (deSitter)
                         ICLRPD (new thread) - (Meerkat)

Sittin' on the Group W bench.
52 ms