Subroutines and Filehandles  
 
 

Week 2

Readings:

  • Read Chapter 4 - Subroutines
  • Read Chapter 5 - Input and Output

Key Concepts:

  • Subroutines
  • File handles
  • Local variables
  • Writing your own warnings
  • Writing your own fatal errors

Exercises:

    From the book:
  • Chapter 4: #1-3
  • Chapter 5
Write a program to read in a given file, use a subroutine to add the line number followed by a space to the beginning of each line and return the new array, and then write to another given file. The filenames should be read off the command line using the @ARGV array, input file listed first, then output file.


Files to Be Downloaded