This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c: pod clarification
[perl5.git] / t / mro / next_ineval.t
CommitLineData
e1a479c5
BB
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
5f5ae4a7 6require q(./test.pl); plan(tests => 1);
e1a479c5
BB
7
8=pod
9
10This tests the use of an eval{} block to wrap a next::method call.
11
12=cut
13
14{
15 package A;
16 use mro 'c3';
17
18 sub foo {
19 die 'A::foo died';
20 return 'A::foo succeeded';
21 }
22}
23
24{
25 package B;
26 use base 'A';
27 use mro 'c3';
28
29 sub foo {
30 eval {
31 return 'B::foo => ' . (shift)->next::method();
32 };
33
34 if ($@) {
35 return $@;
36 }
37 }
38}
39
40like(B->foo,
41 qr/^A::foo died/,
42 'method resolved inside eval{}');
43
44