Sunteți pe pagina 1din 1

Perl Programming Assignment - 3

Prof. H.B. Dave January 22, 2009


Major Topics: How to run system commands; Command line options; Subroutines; Process, string and mathematical functions.

Assignment 3a
Write a Perl script to read a text le, convert the rst character of all words in it to Capitals and display the output.

Assignment 3b
Read a text le containing records, one per line, into a Perl array. Sort this array. Now use the system sort utility to sort the same le and compare the results (programmatically, not manually).

Assignment 3c
The details of command line options are available in: perlrun - how to execute the Perl interpreter Study this document to get the details.

Assignment 3d
Write a subroutine to nd the number of words in a given line (a scaler). Use this subroutine to count and print the number of words in each line of a text le.

Assignment 3e
Write simplest function that returns value of PI.

S-ar putea să vă placă și