summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Hay <SteveHay@planit.com>2004-05-25 17:05:02 +0100
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-05-31 09:52:05 +0000
commit59b0a8b7fe6b66a1488f6943ad58e73704f876b0 (patch)
treef06912bb1f79f36f835ed2880a1a2be0f7205ccd /lib
parente509e6934ce7cafd6c279046164b9b6255429d8a (diff)
downloadperl-59b0a8b7fe6b66a1488f6943ad58e73704f876b0.tar.gz
Fix anomalies in Carp functions
Message-ID: <40B3609E.5060502@uk.radan.com> p4raw-id: //depot/perl@22876
Diffstat (limited to 'lib')
-rw-r--r--lib/Carp.t2
-rw-r--r--lib/Carp/Heavy.pm10
-rw-r--r--lib/autouse.t2
3 files changed, 4 insertions, 10 deletions
diff --git a/lib/Carp.t b/lib/Carp.t
index 2ea98d86d7..cc2da1744c 100644
--- a/lib/Carp.t
+++ b/lib/Carp.t
@@ -11,7 +11,7 @@ print "ok 1\n";
$SIG{__WARN__} = sub {
print "ok $1\n"
- if $_[0] =~ m!ok (\d+)$! };
+ if $_[0] =~ m!ok (\d+)\n at .+\b(?i:carp\.t) line \d+$! };
carp "ok 2\n";
diff --git a/lib/Carp/Heavy.pm b/lib/Carp/Heavy.pm
index 49e10f2679..fe7fec4585 100644
--- a/lib/Carp/Heavy.pm
+++ b/lib/Carp/Heavy.pm
@@ -138,13 +138,8 @@ sub ret_backtrace {
$tid_msg = " thread $tid" if $tid;
}
- { if ($err =~ /\n$/) { # extra block to localise $1 etc
- $mess = $err;
- }
- else {
- my %i = caller_info($i);
- $mess = "$err at $i{file} line $i{line}$tid_msg\n";
- }}
+ my %i = caller_info($i);
+ $mess = "$err at $i{file} line $i{line}$tid_msg\n";
while (my %i = caller_info(++$i)) {
$mess .= "\t$i{sub_name} called at $i{file} line $i{line}$tid_msg\n";
@@ -155,7 +150,6 @@ sub ret_backtrace {
sub ret_summary {
my ($i, @error) = @_;
- my $mess;
my $err = join '', @error;
$i++;
diff --git a/lib/autouse.t b/lib/autouse.t
index bdd2fba883..bc8e401f6b 100644
--- a/lib/autouse.t
+++ b/lib/autouse.t
@@ -39,7 +39,7 @@ use autouse 'Carp' => qw(carp croak);
local $SIG{__WARN__} = sub { push @warning, @_ };
carp "this carp was predeclared and autoused\n";
ok( scalar @warning, 1 );
- ok( $warning[0], "this carp was predeclared and autoused\n" );
+ ok( $warning[0], qr/^this carp was predeclared and autoused\n/ );
eval { croak "It is but a scratch!" };
ok( $@, qr/^It is but a scratch!/);