Commit | Line | Data |
823edd99 |
1 | #!./perl -w |
2 | |
3 | BEGIN { |
fec5e1eb |
4 | if ($ENV{PERL_CORE}){ |
fec5e1eb |
5 | require Config; import Config; |
6 | no warnings 'once'; |
7 | if ($Config{'extensions'} !~ /\bData\/Dumper\b/) { |
8 | print "1..0 # Skip: Data::Dumper was not built\n"; |
9 | exit 0; |
10 | } |
be3174d2 |
11 | } |
823edd99 |
12 | } |
13 | |
14 | use Data::Dumper; |
15 | |
16 | print "1..1\n"; |
17 | |
18 | package Foo; |
19 | use overload '""' => 'as_string'; |
20 | |
21 | sub new { bless { foo => "bar" }, shift } |
22 | sub as_string { "%%%%" } |
23 | |
24 | package main; |
25 | |
26 | my $f = Foo->new; |
27 | |
28 | print "#\$f=$f\n"; |
29 | |
30 | $_ = Dumper($f); |
31 | s/^/#/mg; |
32 | print $_; |
33 | |
34 | print "not " unless /bar/ && /Foo/; |
35 | print "ok 1\n"; |
36 | |