954,523 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Perl question...

Hello,
I'm beginner...
I can't solve this.

id name address

1 cristine New York

2 murray Redmond

3 kumar Sunnyvale

This is 'samples.xlsx' file-Excel type.
'id' string in A1, 'name' in B1, 'address' in C1 column in excel file.


Create a Perl script to store the information about student using the header as in raw 1.
The Perl script should be able to provide data of any student using the id or name or address.
For example: If I need details that who is the person lives in Sunnyvale, the Perl script should give me back the result as Kumar.

Try out usage of GetOptions in Perl script.
How can I manage duplicate data if any...?

chris19750
Newbie Poster
1 post since Apr 2011
Reputation Points: 10
Solved Threads: 0
 

You can solve this if you break it into pieces. If you don't at least try it first all you are going to get is a down vote. First break the problem down, what do you need to do? First you need to read in data, so read up on how to do that. Next you need to figure out how to store the data you read in, read up on data structures particularly the hash. Third you need to accept command line commands from the user so your code knows what to print out, read up on GetOptions (the pkg is actually Getopt::Long and the function out of that package is GetOptions) like your assignment suggests. You shouldn't have any problems pieces together this stuff once you know what you need to do. If you have specific questions then post those and the code that you have tried.

scrappedcola
Posting Whiz in Training
227 posts since Dec 2009
Reputation Points: 27
Solved Threads: 45
 

Hello, I'm beginner... I can't solve this.

id name address

1 cristine New York

2 murray Redmond

3 kumar Sunnyvale

This is 'samples.xlsx' file-Excel type. 'id' string in A1, 'name' in B1, 'address' in C1 column in excel file.

Create a Perl script to store the information about student using the header as in raw 1. The Perl script should be able to provide data of any student using the id or name or address. For example: If I need details that who is the person lives in Sunnyvale, the Perl script should give me back the result as Kumar. Try out usage of GetOptions in Perl script. How can I manage duplicate data if any...?

The wording sounds like an exam question or homework question for a student in a CS class. Did you do your own homework already? The question is written in a way that sounds like you are asking somebody else to do your own work for you.

maba001
Junior Poster in Training
60 posts since Jun 2008
Reputation Points: 9
Solved Threads: 9
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: