Move Attribute::Handlers from lib to ext. The layout in ext is the same as the
[p5sagit/p5-mst-13.2.git] / ext / Attribute-Handlers / demo / demo_cycle.pl
CommitLineData
0e9b9e0c 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";