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...?

Recommended Answers

All 2 Replies

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.

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.

commented: So what if it's a homework task? -1
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.