Полезная информация

Learning Perl on Win32 Systems

Learning Perl on Win32 SystemsSearch this book
Previous: 11.7 The FileHandle ModuleChapter 11
Formats
Next: 12. Directory Access
 

11.8 Exercises

See Appendix A, Exercise Answers for answers.

  1. Write a program that reads a file containing a list of lines composed of a user name, a company name, and an email address separated by colons. A sample line might look like this:

         John Doe:Foo Technologies:jdoe@footech.com

    Print out each field in formatted columns. Use format and write.

  2. Add a top-of-page format to the previous program. (If your file is relatively short, you might need to set the pagelength to something like 10 lines so that you can get multiple instances of the top-of-page.)

  3. Add a sequentially increasing page number to the top-of-page, so that you get page 1, page 2, and so on, in the output.


Previous: 11.7 The FileHandle ModuleLearning Perl on Win32 SystemsNext: 12. Directory Access
11.7 The FileHandle ModuleBook Index12. Directory Access