On Wed, Jan 26, 2022 at 7:57 AM William Lindley <wlindley@wlindley.com> wrote: > > On 1/25/22 8:05 PM, Tom Molesworth via perl5-porters wrote: > > Could we move over to a common object-based format, for example - one that provides message, diagnostic information, error codes, categories and/or tags? > > Applicable precedent would be VMS error code format; apt since DEC's BASIC-PLUS was "an ancient language from which Perl derived exactly one idea [or maybe two, per footnote]" -- Programming Perl, first edition, p. 414. VMS errors (1975) nearly predate the concept of object-oriented programming (except Smalltalk 72 and a few others) but the goal is identical: Make understanding and debugging errors easy. > > For example, in VMS style (facility, level [I=informational, W=warning, E=error], identification, text), we might have had: > > %PERL-W-WIDECHAR, Wide character in print at -e line 1. > > which isn't much nicer but at least the error code is easily found in an index or search. (In actuality, error codes were passed to the OS as integers and the text came from a disk file, RAM being more precious in those days, a convergence of utility and usefulness.) A recent explanation of this heritage format is https://www.ibm.com/docs/en/ds8800?topic=system-openvms-messages-exit-codes The IBM storage docs look fine but the 32-bit VMS condition code format is authoritatively described in the Programming Concepts manual published by the OS vendor: <https://docs.vmssoftware.com/vsi-openvms-programming-concepts-manual-volume-i/#COND_VAL_FORM_VAXALPHA> Whether this scheme is useful prior art for rethinking Perl warnings, or whether Perl warnings can be fundamentally rethunk without breaking too many things is more than I can adequately consider before breakfast. One of the convenient things on VMS is that codes for internal communication within the program are part of the same scheme as exit codes for communicating status to the outside world at program exit. I can't think of a way that could work portably. > p.s., Actually, I wonder what the VMS port of Perl used for error codes... anyone got Perl on a simh VAX/VMS instance? The VMS condition code that is returned by things Perl calls internally is captured in $^E. $! gives you the CRTL equivalent, which in many cases means you have two different ways to be told "file not found" but in some cases you get a more specific message from $^E. As far as I know, all this is completely orthogonal to Perl warnings because there are no errno values for those warnings and no mechanism for defining your own range of errno values. I removed VAX support years ago because there were just too many limitations, but Perl still runs on Alpha and Itanium. It can also be built for the pre-release version of OpenVMS x86 with a lot of manual steps during the build to handle the cross-compile environment.Thread Previous | Thread Next