Hour 5. Working with Files
What You'll Learn in This Hour:
How to open and close files
How to write data to files
How to read data from files
How to write Perl defensively so that your programs are robust
Until now, your Perl programs have been self-contained. They have been unable to communicate with the outside world other than to provide messages to the user and receive input from the keyboard. All of that is about to change.
Perl is an outstanding language for reading from and writing to files on disk or elsewhere. Perl's scalars can stretch to hold the longest possible record in a file, and Perl's arrays can stretch to hold the entire contents of files—as long as enough memory is available, of course. When the data is contained within Perl's ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access