summaryrefslogtreecommitdiffstats
path: root/contrib/perl5/t/lib/dumper-ovl.t
blob: db4a5d9e7525a9a62fe94465231fd36972719507 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!./perl -w

BEGIN {
    chdir 't' if -d 't';
    @INC = '../lib' if -d '../lib';
}

use Data::Dumper;

print "1..1\n";

package Foo;
use overload '""' => 'as_string';

sub new { bless { foo => "bar" }, shift }
sub as_string { "%%%%" }

package main;

my $f = Foo->new;

print "#\$f=$f\n";

$_ = Dumper($f);
s/^/#/mg;
print $_;

print "not " unless /bar/ && /Foo/;
print "ok 1\n";

OpenPOWER on IntegriCloud