[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] MacPerl warn and die format



I'm pondering the implications of MacPerl's formatting of warn and die
messages when the string is not terminated in a newline.

For example, in MacPerl:

    # Warning: something's wrong, <> chunk 1.
    File ':test.pl'; Line 1

    # Died.
    File ':test.pl'; Line 1


Whereas the 'standard' format is:

    Warning: something's wrong at test.pl line 1, <> chunk 1.

    Died at test.pl line 1.



I'm curious why it is that MacPerl uses such a different format for warn
and die.

This makes a difference to modules such as Exporter, which try to do
munging of the error message:

    local $SIG{__WARN__} = sub {
        my $text = shift;
        if ($text =~ s/ at \S*Exporter.pm line \d+.*\n//) {
            require Carp;
            local $Carp::CarpLevel = 1; # ignore package calling us too.
            Carp::carp($text);
        }
        else {
            warn $text;
        }
    };



Would there be any problems in having MacPerl use the same format as the
regular distribution?

Ronald


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch