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