This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Resync with mainline
[perl5.git] / t / lib / dumper-ovl.t
CommitLineData
823edd99
GS
1#!./perl -w
2
3BEGIN {
4 chdir 't' if -d 't';
93430cb4 5 unshift @INC, '../lib' if -d '../lib';
823edd99
GS
6}
7
8use Data::Dumper;
9
10print "1..1\n";
11
12package Foo;
13use overload '""' => 'as_string';
14
15sub new { bless { foo => "bar" }, shift }
16sub as_string { "%%%%" }
17
18package main;
19
20my $f = Foo->new;
21
22print "#\$f=$f\n";
23
24$_ = Dumper($f);
25s/^/#/mg;
26print $_;
27
28print "not " unless /bar/ && /Foo/;
29print "ok 1\n";
30