File: ref.t

package info (click to toggle)
libdata-dump-perl 1.25-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 188 kB
  • sloc: perl: 1,173; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 359 bytes parent folder | download | duplicates (8)
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
#!perl -w

use strict;
use Test qw(plan ok);

plan tests => 2;

use Data::Dump qw(dump);

my $s = \\1;
ok(nl(dump($s)), <<'EOT');
\\1
EOT

my %s;
$s{C1} = \$s{C2};
$s{C2} = \$s{C1};
ok(nl(dump(\%s)), <<'EOT');
do {
  my $a = { C1 => \\do{my $fix}, C2 => 'fix' };
  ${${$a->{C1}}} = $a->{C1};
  $a->{C2} = ${$a->{C1}};
  $a;
}
EOT

sub nl { shift(@_) . "\n" }