Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / 5.8.0 / Attribute / Handlers / demo / demo_cycle.pl
CommitLineData
86530b38
AT
1package Selfish;
2
3sub TIESCALAR {
4 use Data::Dumper 'Dumper';
5 print Dumper [ \@_ ];
6 bless [ @_[1..$#_] ], $_[0];
7}
8
9sub FETCH {
10 use Data::Dumper 'Dumper';
11 Dumper [ @{$_[0]} ];
12}
13
14package main;
15
16use Attribute::Handlers autotieref => { Selfish => Selfish };
17
18my $next : Selfish("me");
19print "$next\n";
20
21my $last : Selfish("you","them","who?");
22print "$last\n";
23
24my $other : Selfish(["you","them","who?"]);
25print "$other\n";