NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Data munging with ... (Score:1, Interesting)
Re:Data munging with ... (Score:4, Insightful)
(Caveat - I have not read Dave's book, so I don't know exactly what is in it.) "core" C (c.f. "core" perl) would be hard, as I think that to do it properly you'd have to re-implement Perl's data structures in C. However, I don't know if any freely available C libraries give you enough to avoid that step, and hence make writing data munging with foolib viable.
However, rather than pure "Data munging with Python" what I'd really like to see is "Data munging with Perl/Python/Ruby/TCL" (say) where there are equivalent code examples in all 4 (or 3? too many?) languages, so that you can directly see how they map to each other. For that matter, "Data munging in Perl6" could also be quite informative.
Reply to This
Parent
Re:Data munging with ... (Score:1)
Amen!
I've been waiting for a while to see a book that intelligently presents (and possibly compares) the same technique in several languages, and since text munging is su
(darren)
How would this work ? (Score:1)
There are equivalent command structures in both languages, but would just translating code segments cut it, really ? Some of the most useful things I learnt from the book are specific to Perl.. (fiddling with the record separator variable, for example)
Then again, (this is because I dont know any better :) ), does Python have an equivalent to Parse::RecDescent ? (there is one chapter worth of material on that module alone)
Re:How would this work ? (Score:2, Insightful)
Not as such. There are several parser building libraries available, but none of them have the breadth and scope of Parse::RecDescent.
This is, I think, because the Python community doesn't have a specifically-retained Mad Scientist. The language can definitely natively support a Parse::RecDescent-type module (as opposed to C, like Nicholas points out), though.
(darren)
Re:How would this work ? (Score:1)
------------------------------
You are what you think.
Python is a decent language (Score:1)
You could do a lot worse than pick up some Python -- it's a nice language, with a lot going for it. And, for as much as we in Perl community like to complain about it, it's a lot more similar to Perl than many other languages that we don't complain about (it's just an easier target that many other languages).
(darren)
Text Processing in Python (Score:1)
I meant to mention this earlier. David Mertz is writing a similar book, called Text Processing In Python [gnosis.cx], which looks like it will be pretty good.
<heckle>The full contents of the book are available on his site.</heckle>
(darren)