Workshop
Quiz
1: | To open a file named data for writing, you should use which of the following:
|
2: | (-M $file > 1 and -s $file) is true if
|
Answers
A1: | c. Choice a is false because this is not how open opens a file for writing; b is false because it opens the filehandle only for reading. Choice c is true because it does what is asked—and uses good form by checking for errors. |
A2: | a. –M returns the number of days old a file is (>1 is more than 1 day), and –s returns true if the file has data in it. |
Activities
Modify ...
Get SAMS Teach Yourself Perl in 24 Hours THIRD EDITION now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.