Sign in to follow this  

Can somebody explain this code to me, please

This topic is 1267 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this