Workshop
Quiz
1: | To print the last modification time of the file foofile, use
|
2: | The unlink function returns
|
Answers
A1: | b or c. Choice b prints the time expressed as the number of seconds since 1970—not very useful. Choice c prints the time as a nicely formatted string. |
A2: | a. However, choice b is also somewhat true. If no files can be deleted, unlink returns 0, which is false. |
Activities
As a programming exercise only, try to write a program that lists all the files in a directory, in its subdirectories, and so on.
Get Sams Teach Yourself Perl in 24 Hours 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.