Can somebody explain this code to me, please

Started by
3 comments, last by rAm_y_ 9 years, 8 months ago

So the code is a perl script, that combines the data of two csv files and then creates a new csv file with the combined data

this is the code http://pastebin.com/5gf61afg, the thing is I'm new to perl and somebody else wrote this not me, I'm so I'm trying to understand the code but I just can't, and so I'm wondering if someone could help me out here, and describe to me what's going on in the code for the parts where the combination of data is happening and the way the new file is created. Thank you.

Advertisement
I sometimes need to read Perl as part of my job, and I refuse to do it when I am not getting paid. smile.png

You can figure out a lot of things by running the program in the debugger (perl -d), if you have an environment where you can run it.

I don't know perl, but isn't it supposed to be a write-only language?

openwar - the real-time tactical war-game platform

Yep, perl is a WORN language (write-once read never).

Its funny, because the script you posted is actually really "cleanly" done for perl. It avoids being terse on purpose and uses some comments. However the person still comment like a CS student (commenting the "what" instead of the "why" ... and since they do, it isn't readable without spending at least 10-15 minutes digging into it more deeply.

Well you start by reading in comma delimeted file you then seperate the values/text into arrays spliting on the commas, looks like ip address then you print it to an excel file.

This topic is closed to new replies.

Advertisement