Skip to Content
Perl To Python Migration
book

Perl To Python Migration

by Martin C. Brown
November 2001
Beginner
320 pages
5h 53m
English
Pearson Business
Content preview from Perl To Python Migration

Chapter 6. EXCEPTIONS AND ERROR TRAPPING

Error trapping and handling is a necessary part of all programming. There are many different specific reasons for trapping an error, but they basically come down to two basic reasons:

  1. Avoiding doing something that would cause the program/application to fail at a later stage. For example, checking that we've opened a file correctly before we start writing to it.

  2. Letting the user know when something has happened that either you didn't plan on or expect. For example, suddenly running out of disk space.

The model used by Perl is borrowed heavily from the C and shell script methods of checking the results of function calls. This presents some problems when dealing with certain errors, and also makes propagating ...

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.
Start your free trial

You might also like

Perl in a Nutshell

Perl in a Nutshell

Nathan Patwardhan, Ellen Siever, Stephen Spainhour
Perl by Example

Perl by Example

Ellie Quigley
Perl Hacks

Perl Hacks

Chromatic, Damian Conway, Curtis Ovid Poe, Curtis (Ovid) Poe

Publisher Resources

ISBN: 0201734885Purchase book