Graham Kemp > Programming Tools |
After this practical you will:
Try out some of the scripts from the lecture. Some of these are in directory /users/mdstud/kemp/ptools/perl/lecture1/.
Copy the program countdown.pl and modify it so that it counts down from a number entered by the user in response to a prompt, e.g.
unix> ./countdown2.pl Type in a number: 3 3... 2... 1... BOOM! unix>
Copy your solution for Question 2 and modify it so that it uses a "for" loop instead of a "while" loop.
Copy your solution for Question 3 and modify it so that it counts down from a number given as a command line argument.
unix> ./countdown4.pl 3 3... 2... 1... BOOM! unix>
File /users/mdstud/kemp/ptools/unix3/names contains the names of some of the students taking this course. Write a Perl program that reads this file and writes out an HTML file with a table containing the students' names in the first column and their lab account usernames in the second column (like http://www.cs.chalmers.se/~kemp/teaching/programming_tools/2004/local/accounts.html but with the columns reversed).