[% setvar title Improvement needed in error messages (both internal errors and die function). %]

This file is part of the Perl 6 Archive

Note: these documents may be out of date. Do not use as reference!

To see what is currently happening visit http://www.perl6.org/

TITLE

Improvement needed in error messages (both internal errors and die function).

VERSION

  Maintainer: S. A. Janet <stosh@eskimo.com>
  Date: 30 Sep 2000
  Mailing List: perl6-language-errors@perl.org
  Number: 359
  Version: 1
  Status: Developing

ABSTRACT

Error messages should contain the word `ERROR' in them. Messages due to internal errors should contain `INTERNAL ERROR'.

Error messages should also contain the program name, or if that is not known, the word `perl'.

DESCRIPTION

Internal error messages should be improved. For example,

                % perl -le 'print "PRIME" if (1 x shift) !~ /^(11+)\1+$/' 373403020102920303
                Out of memory!

is a poor message. This is better: "perl: FATAL ERROR: out of memory".

IMPLEMENTATION

This should require very minor improvements to die and the addition of a function e.g. setprogramname() to register the program name internally:

                % cat foo.pl
                setprogramname( $0 );
                die "filenames expected" if ( $#ARGV < 0 );
                ...
                $ perl foo.pl
                foo.pl: FATAL ERROR: filenames expected

REFERENCES

None.