This seems fairly simple and the assignment (well, it really looks like a homework assignment, and the monks here usually prefer when the poster says it upfront)) tells you how to do.
Basically, you first need to read the genes source (NCNI) and load the gene IDs and sequences into a hash. Once this is done, you ask your user to enter a gene ID. Chomp the user input and lookup in the hash if you find it. If the value is defined for the ID, just print the value (sequence); if not, print an error message.
Turning that into Perl is not complicated, and you should really try to do it yourself. If you encouter somme difficulties, feel free to post your code and explain in which respect it does not work as you would expect/want.