text manipulation: Python or Perl

Status
Not open for further replies.

Coleman

Ars Legatus Legionis
16,790
Subscriptor
I want to throw a quick program together to pase data from a flat file format into an XML structure. I'm curious on opinions if Python or Perl would be a better route to go for this. I've got background in coding C and VB. Needless to say, VB is horrible for this type of thing. I'd like to try it in something other then C, so I'm looking at Python and Perl...any advice or other options as to what way to do it?
Thanks!
Jason
 

GasMannJoel

Ars Scholae Palatinae
747
Originally posted by colema19:
I want to throw a quick program together to pase data from a flat file format into an XML structure. I'm curious on opinions if Python or Perl would be a better route to go for this. I've got background in coding C and VB. Needless to say, VB is horrible for this type of thing. I'd like to try it in something other then C, so I'm looking at Python and Perl...any advice or other options as to what way to do it?
Thanks!
Jason

i would do it in perl, but thats mostly because i dont know python, so i dont know what its good/better at - but what your describing sounds like a pretty easy perl script.
 
1. Life is too short to learn PERL.

2. Python is fun.

3. You could learn Python in an afternoon.

4. There are 23 online Ptyhon tutorials at http://www.awaretek.com

5. Python is easier to learn.

6. Python is easier to use.

7. Ptyhon is easier to remember.

8. Python is easier to read.

9. The Python community and comp.lang.pyhton are freidnly and fun.

10. Did I mention that python is easy and fun?
 
I have never tried doing regexps in Python, although I have begun learning it, but I have done some in Perl. Generally it's very easy to get started, but if you get complex data structures then you start to feel the pain.

So as long as you're not trying to make very complex stuff I think you'll have a lot easier time with Perl given your experience in C. (It's quite similar in the syntax.) Python is nice and all, but they have done changes which takes some time to accept. (Like you don't write for-loops as in every other sane language, there are benefits to their approach, but it still feel like Pascal to me.)
 

dockeen

Ars Tribunus Militum
1,600
Ursus is probably perturbed with me for saying Perl. :)
I promise, for ME, Python is still my baby!

As I was mumbling earlier, and Hast was nice enough to put into real words, C and Perl syntax are very similar, so that may make you more comfortable. (I actually learned to do a number of things in Perl before I learned them in C)

Actually, most of the scripting type languages have a good deal of regular expression capability. You could probably do what you want in Ruby for that matter.

Wayne
 
Don't worry, Dockeen, I myself flirted quite openly with Ruby a while back; but she was too much woman for me, and I fled back home to Python. ;-)))

Hey, Python happens to be the language I love, mostly because it was easy enough for me to learn enough to do anything with it...

Ruby is beautiful too, and Perl, well, Perl started the whole genre...and C, well without it, none of us would be here, I suspect...

Ah well, better to have loved and lost, than never to have loved at all...

or something like that ;-)))
 
Status
Not open for further replies.