Edit the cabeza.pl program so it will
open the file specified in the variable $filename,
read up to 10 lines, and output them to standard out.
For example, to print the first 10 lines of the file
"INSTRUCTIONS", it will look like:

command

./cabeza.pl INSTRUCTIONS

output

http://sc.tamu.edu/shortcourses/SC-perl/lab/ex2/
Exercise 3 : Reading and writing files
Laboratory Exercise for Introduction to Perl
This assumes you have already set up your initial directory with the
init-perllab command.

Edit the program so it will open the file
"squares.dat" and write a line for
each value from the value in $start
to the value in $end. On each line,
print the value and the square of the value. For example,
an input of 3 for start and 11 for end would result in
the file "squares.dat" containing:

output

3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100
11 121

For reference, read the perl documentation on
open(),
printf(), and
die(). You can also view these
from eos by typing: