Chap. 5: Input and Output 1. How does P6 read a succession of lines from standard input? 2. Does it matter whether you use a 'for' control structure or a 'while' control structure when you are reading lines from STDIN? 3. Does P6 have any line-input operator suitable for getting input from sources other than STDIN? 4. How does P6 store the name of a file (or STDIN) from which a program is getting input? 5. How does P6 store the list of arguments with which a program is invoked? * Is this list manipulable? 6. How does P6 provide output to STDOUT? * Is this output buffered? * If so, is this buffering overrideable? 7. Are there circumstances in which 'print' is sometimes a list operator and sometimes a function call? 8. How does P6 handle formatted output (like 'printf')? * Interaction with arrays 9. What does P6 call the input/output connection between a P6 process and the outside world? * [Assume that the term is: filehandle] * What restrictions, if any, are there on the spelling of filehandles? 10. What special filehandles does P6 have? Describe each. 11. In what ways can P6 open a filehandle? * When opening a filehandle, how does P6 handle the difference between mode and filename? 12. In what ways can P6 close a filehandle? 13. How does P6 handle fatal errors? * Does P6 provide a human-readable complaint message in case of fatal error? 14. How can the default output filehandle be changed in P6? 15. How do you send error messages to a log file rather than to STDERR? Exercises: Learning Perl, 4th ed., p. 87 # vim: textwidth=100: