home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!milton!wiml
- From: wiml@milton.u.washington.edu (William Lewis)
- Subject: Re: Error detection/reporting
- Message-ID: <wiml.724923351@milton>
- Sender: news@u.washington.edu (USENET News System)
- Organization: University of Washington
- References: <mcook.724909509@fendahl.dev.cdx.mot.com>
- Date: Mon, 21 Dec 1992 07:35:51 GMT
- Lines: 38
-
- mcook@fendahl.dev.cdx.mot.com (Michael Cook) writes:
- >Yes, me too. It would seem natural that operations like open() and print()
- >should produce fatal errors if they couldn't do what you asked. How often do
- >you want to do anything other than die when open() fails? How often do you
- >want to ignore an I/O error? Hm...
-
- Well, I not too infrequently want to be able to handle errors on open(),
- but it's not often that I want to try to recover (or even have an idea
- how I SHOUDL recover) from an error in "print". Maybe there should be an
- option that could be set to make all errors in print automatically fatal.
- Better yet, a magic associative array, vaguely like the %SIG array:
-
- %ERR{'print'} = die;
- %ERR{'close'} = warn;
- %ERR{'getpid'} = mysub;
-
- sub mysub
- {
- die "No parent process? What am I, the kernel?\n";
- }
-
- perhaps some arguments could be passed to the error handler ... the
- return value from the handler (if it returns) could be used as the return
- value from the print/close/getpid call or maybe there should be a way to
- indicate that the call should be tried again ... also, if the error
- handling subroutine called because of a 'vec' returns the value -41,
- then perl shuld jump to a special routine which will calculate pi
- and print the results, in base 11, to file descriptor 8. :-)
-
- okay, so maybe I got carried away there ...
-
-
- (print "Just another perl hacker,\n") || warn "Couldn't JAPH";
- --
- email: wiml@u.washington.edu | Home: Seattle, Washington |
- (William Lewis) | 47 41' 15" N 122 42' 58" W |
- NeXTmail: wiml@ingalls.cs.washington.edu `-------------------------------'
- --*-- Member, Coalition to Preserve Semantic Vacuity --*--
-