![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
a REFERENCE of array of hashesby fseng (Novice) |
on Jun 24, 2009 at 05:53 UTC ( #774258=perlquestion: print w/replies, xml ) | Need Help?? |
fseng has asked for the wisdom of the Perl Monks concerning the following question:
Hi everyone, I'm just starting learning Perl. Work give me this exercise to do which I found a bit hard.I need to come back with answers tomorrow afternoon. So answers to any question will be great help please!!! QUESTION1: Write a program to read in the following comma delimited data file into a data structure of A REFERENCE ARRAY OF HASHES, and performs each of the steps: a) Read in the records and write them out as 15 characters each with the first name in capitals. b) Print out a sorted list of Surnames only. c) Print all lines except those with member numbers 34 and 11. d) Write a new file with the records in reverse order (i.e. print the last record first). e) Write a new file with only rows where the score is greater than 100. f) Read in file you made in question a) and write it out as tab delimited records. QUESTION 2 There are two data files with contents as follows: a) Write code to print only those client details that have their key in extracts.txt. Note that there are (at least) two main ways to do this. b) Comment on how well your solution scales for files with hundreds of thousands of records (Hints: the extracts list should be much shorter than the whole clients list. How would you approach this question if both data files are huge?)
Back to
Seekers of Perl Wisdom
|
|