Jump to content

  • Log In with Google      Sign In   
  • Create Account

Can somebody explain this code to me, please


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
4 replies to this topic

#1 Brainx7   Members   -  Reputation: 124

Like
0Likes
Like

Posted 29 July 2014 - 09:39 AM

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.



Sponsor:

#2 Álvaro   Crossbones+   -  Reputation: 13901

Like
8Likes
Like

Posted 29 July 2014 - 11:49 AM

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.

#3 Felix Ungman   Members   -  Reputation: 1066

Like
7Likes
Like

Posted 29 July 2014 - 12:06 PM

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


openwar  - the real-time tactical war-game platform


#4 Xai   Crossbones+   -  Reputation: 1459

Like
0Likes
Like

Posted 29 July 2014 - 10:59 PM

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.



#5 rAm_y_   Members   -  Reputation: 481

Like
0Likes
Like

Posted 30 July 2014 - 01:19 PM

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.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS