1use warnings;
2use strict;
3use Test::More tests => 2;
4
5BEGIN { use_ok('NEXT') };
6
7
8package Foo;
9
10use overload '""' => 'stringify';
11
12use constant BAR => (1..5);
13
14sub new { bless {}, shift }
15
16sub stringify {
17    my $self = shift;
18    my %result = $self->EVERY::LAST::BAR;
19    join '-' => @{ $result{'Foo::BAR'} };
20}
21
22
23
24package main;
25
26my $foo = Foo->new;
27is("$foo", '1-2-3-4-5', 'overloading stringification');
28
29