summaryrefslogtreecommitdiff
path: root/ext/Data
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-04 04:27:51 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-04 04:27:51 +0000
commit3cb6de8118f279c0dca172ac40ef21e89cf524b7 (patch)
treeceb152b91deb401b084cf01870d011c2ece3e17a /ext/Data
parenteaf840779373130f95f7bd459b3864c78c698e28 (diff)
downloadperl-3cb6de8118f279c0dca172ac40ef21e89cf524b7.tar.gz
more whitespace removal (from Michael G Schwern)
p4raw-id: //depot/perl@5507
Diffstat (limited to 'ext/Data')
-rw-r--r--ext/Data/Dumper/Dumper.pm44
1 files changed, 22 insertions, 22 deletions
diff --git a/ext/Data/Dumper/Dumper.pm b/ext/Data/Dumper/Dumper.pm
index 00f623d474..c86299c619 100644
--- a/ext/Data/Dumper/Dumper.pm
+++ b/ext/Data/Dumper/Dumper.pm
@@ -889,7 +889,7 @@ distribution for more examples.)
$boo = [ 1, [], "abcd", \*foo,
{1 => 'a', 023 => 'b', 0x45 => 'c'},
\\"p\q\'r", $foo, $fuz];
-
+
########
# simple usage
########
@@ -910,12 +910,12 @@ distribution for more examples.)
$Data::Dumper::Useqq = 1; # print strings in double quotes
print Dumper($boo);
-
-
+
+
########
# recursive structures
########
-
+
@c = ('c');
$c = \@c;
$b = {};
@@ -924,24 +924,24 @@ distribution for more examples.)
$b->{b} = $a->[1];
$b->{c} = $a->[2];
print Data::Dumper->Dump([$a,$b,$c], [qw(a b c)]);
-
-
+
+
$Data::Dumper::Purity = 1; # fill in the holes for eval
print Data::Dumper->Dump([$a, $b], [qw(*a b)]); # print as @a
print Data::Dumper->Dump([$b, $a], [qw(*b a)]); # print as %b
-
-
+
+
$Data::Dumper::Deepcopy = 1; # avoid cross-refs
print Data::Dumper->Dump([$b, $a], [qw(*b a)]);
-
-
+
+
$Data::Dumper::Purity = 0; # avoid cross-refs
print Data::Dumper->Dump([$b, $a], [qw(*b a)]);
-
+
########
# deep structures
########
-
+
$a = "pearl";
$b = [ $a ];
$c = { 'b' => $b };
@@ -953,23 +953,23 @@ distribution for more examples.)
$Data::Dumper::Maxdepth = 3; # no deeper than 3 refs down
print Data::Dumper->Dump([$f], [qw(f)]);
-
+
########
# object-oriented usage
########
-
+
$d = Data::Dumper->new([$a,$b], [qw(a b)]);
$d->Seen({'*c' => $c}); # stash a ref without printing it
$d->Indent(3);
print $d->Dump;
$d->Reset->Purity(0); # empty the seen cache
print join "----\n", $d->Dump;
-
-
+
+
########
# persistence
########
-
+
package Foo;
sub new { bless { state => 'awake' }, shift }
sub Freeze {
@@ -978,7 +978,7 @@ distribution for more examples.)
$s->{state} = 'asleep';
return bless $s, 'Foo::ZZZ';
}
-
+
package Foo::ZZZ;
sub Thaw {
my $s = shift;
@@ -986,7 +986,7 @@ distribution for more examples.)
$s->{state} = 'awake';
return bless $s, 'Foo';
}
-
+
package Foo;
use Data::Dumper;
$a = Foo->new;
@@ -997,12 +997,12 @@ distribution for more examples.)
print $c;
$d = eval $c;
print Data::Dumper->Dump([$d], ['d']);
-
-
+
+
########
# symbol substitution (useful for recreating CODE refs)
########
-
+
sub foo { print "foo speaking\n" }
*other = \&foo;
$bar = [ \&other ];