From: Jarkko Hietaniemi Date: Sun, 9 Dec 2001 15:20:08 +0000 (+0000) Subject: Remove Attribute::Handlers, as per Damian's request. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c27482a4ae759620db85e55c84e6da0b10b95e5a;p=p5sagit%2Fp5-mst-13.2.git Remove Attribute::Handlers, as per Damian's request. (Because of fixing the my variables to be now handled in run-time, the whole internals of the A::H needs to be rewritten and Damian will not have time for that for months.) p4raw-id: //depot/perl@13544 --- diff --git a/MANIFEST b/MANIFEST index 64e87cf..a2cb674 100644 --- a/MANIFEST +++ b/MANIFEST @@ -788,24 +788,6 @@ lib/abbrev.pl An abbreviation table builder lib/AnyDBM_File.pm Perl module to emulate dbmopen lib/AnyDBM_File.t See if AnyDBM_File works lib/assert.pl assertion and panic with stack trace -lib/Attribute/Handlers.pm Attribute::Handlers -lib/Attribute/Handlers/Changes Attribute::Handlers -lib/Attribute/Handlers/demo/demo.pl Attribute::Handlers demo -lib/Attribute/Handlers/demo/Demo.pm Attribute::Handlers demo -lib/Attribute/Handlers/demo/demo2.pl Attribute::Handlers demo -lib/Attribute/Handlers/demo/demo3.pl Attribute::Handlers demo -lib/Attribute/Handlers/demo/demo4.pl Attribute::Handlers demo -lib/Attribute/Handlers/demo/demo_call.pl Attribute::Handlers demo -lib/Attribute/Handlers/demo/demo_chain.pl Attribute::Handlers demo -lib/Attribute/Handlers/demo/demo_cycle.pl Attribute::Handlers demo -lib/Attribute/Handlers/demo/demo_hashdir.pl Attribute::Handlers demo -lib/Attribute/Handlers/demo/demo_phases.pl Attribute::Handlers demo -lib/Attribute/Handlers/demo/demo_range.pl Attribute::Handlers demo -lib/Attribute/Handlers/demo/demo_rawdata.pl Attribute::Handlers demo -lib/Attribute/Handlers/demo/Descriptions.pm Attribute::Handlers demo -lib/Attribute/Handlers/demo/MyClass.pm Attribute::Handlers demo -lib/Attribute/Handlers/README Attribute::Handlers -lib/Attribute/Handlers/t/multi.t See if Attribute::Handlers works lib/attributes.pm For "sub foo : attrlist" lib/AutoLoader.pm Autoloader base class lib/AutoLoader.t See if AutoLoader works diff --git a/lib/Attribute/Handlers/Changes b/lib/Attribute/Handlers/Changes deleted file mode 100644 index 1b5e620..0000000 --- a/lib/Attribute/Handlers/Changes +++ /dev/null @@ -1,73 +0,0 @@ -Revision history for Perl extension Attribute::Handlers - -0.50 Sat Apr 21 16:09:31 2001 - - original version; - -0.51 Tue May 1 06:33:15 2001 - - - Fixed fatal file path error in MANIFEST (thanks Marcel and Jost) - - -0.60 Thu May 10 15:46:02 2001 - - - Added RAWDATA specifier - - - Cleaned up documentation (thanks Garrett) - - - Added warning for all-lowercase handlers (thanks Garrett) - - - Added autotie functionality - - - Tweaked handling of anon arrays as attribute args - - -0.61 Thu May 10 16:28:06 2001 - - - Critical doc patch - - -0.70 Sun Jun 3 07:40:03 2001 - - - Added __CALLER__ pseudo class for 'autotie' - - - Added multi-phasic attribute handlers (thanks Garrett) - - - Fixed nasty $SIG{__WARN__}-induced bug - - - Cached ref/symbol mapping for better performance and more - reliable symbol identification under evil typeglob manipulations - - - Added option to pass arguments when autotied classes are imported - (thanks Marcel) - - - Fixed bug in handling of lexical SCALAR refs - - - Cleaned up interactions with other class hierarchies - (due to being base class of UNIVERSAL) - - -0.75 Mon Sep 3 09:07:08 2001 - - - Cleaned up AUTOLOAD - - - Numerous bug fixes (thanks Pete) - - - Fixed handling of attribute data that includes a newline (thanks Pete) - - - Added "autotieref" option (thanks Pete) - - - Switched off $DB::single - - - Changed licence for inclusion in core distribution - - - Fixed 'autotie' for tied classes with multi-level names (thanks Jeff) - - -0.76 Thu Nov 15 06:31:51 2001 - - - Fixed documentation nit (thanks Rick) - - - Improving intuitiveness of autotie mechanism (thanks Marcel) - - - Added $VERSION numbrs to demo modules (seems bizarre to me, but - they're core too now). diff --git a/lib/Attribute/Handlers/README b/lib/Attribute/Handlers/README deleted file mode 100644 index c9e067c..0000000 --- a/lib/Attribute/Handlers/README +++ /dev/null @@ -1,74 +0,0 @@ -============================================================================== - Release of version 0.76 of Attribute::Handlers -============================================================================== - - -NAME - Attribute::Handlers - Simpler definition of attribute handlers - -DESCRIPTION - This module, when inherited by a package, allows that package's class to - define attribute handler subroutines for specific attributes. Variables - and subroutines subsequently defined in that package, or in packages - derived from that package may be given attributes with the same names as - the attribute handler subroutines, which will then be called at the end - of the compilation phase (i.e. in a `CHECK' block). - -EXAMPLE - - package UNIVERSAL; - use Attribute::Handlers; - - my %name; - sub name { return $name{$_[2]}||*{$_[1]}{NAME} } - - sub Name :ATTR { $name{$_[2]} = $_[4] } - - sub Purpose :ATTR { print STDERR "Purpose of ", &name, " is $_[4]\n" } - - sub Unit :ATTR { print STDERR &name, " measured in $_[4]\n" } - - - package main; - - my $capacity : Name(capacity) - : Purpose(to store max storage capacity for files) - : Unit(Gb); - - package Other; - - sub foo : Purpose(to foo all data before barring it) { } - - -AUTHOR - Damian Conway (damian@conway.org) - -COPYRIGHT - Copyright (c) 2001, Damian Conway. All Rights Reserved. - This module is free software. It may be used, redistributed - and/or modified under the same terms as Perl itself. - - -============================================================================== - -CHANGES IN VERSION 0.76 - - - - Fixed documentation nit (thanks Rick) - - - Improving intuitiveness of autotie mechanism (thanks Marcel) - - - Added $VERSION numbrs to demo modules (seems bizarre to me, but - they're core too now). - - -============================================================================== - -AVAILABILITY - -Attribute::Handlers has been uploaded to the CPAN -and is also available from: - - http://www.csse.monash.edu.au/~damian/CPAN/Attribute-Handlers.tar.gz - -============================================================================== diff --git a/lib/Attribute/Handlers/demo/Demo.pm b/lib/Attribute/Handlers/demo/Demo.pm deleted file mode 100755 index e763d23..0000000 --- a/lib/Attribute/Handlers/demo/Demo.pm +++ /dev/null @@ -1,50 +0,0 @@ -$DB::single = 1; - -package Demo; -$VERSION = '1.00'; -use Attribute::Handlers; -no warnings 'redefine'; - -sub Demo : ATTR(SCALAR) { - my ($package, $symbol, $referent, $attr, $data, $phase) = @_; - $data = '' unless defined $data; - print STDERR 'Scalar $', *{$symbol}{NAME}, - " ($referent) was ascribed ${attr}\n", - "with data ($data)\nin phase $phase\n"; -}; - -sub This : ATTR(SCALAR) { - print STDERR "This at ", - join(":", map { defined() ? $_ : "" } caller(1)), - "\n"; -} - -sub Demo : ATTR(HASH) { - my ($package, $symbol, $referent, $attr, $data) = @_; - $data = '' unless defined $data; - print STDERR 'Hash %', *{$symbol}{NAME}, - " ($referent) was ascribed ${attr} with data ($data)\n"; -}; - -sub Demo : ATTR(CODE) { - my ($package, $symbol, $referent, $attr, $data) = @_; - $data = '' unless defined $data; - print STDERR 'Sub &', *{$symbol}{NAME}, - " ($referent) was ascribed ${attr} with data ($data)\n"; -}; - -sub Multi : ATTR { - my ($package, $symbol, $referent, $attr, $data) = @_; - $data = '' unless defined $data; - print STDERR ref($referent), ' ', *{$symbol}{NAME}, - " ($referent) was ascribed ${attr} with data ($data)\n"; -}; - -sub ExplMulti : ATTR(ANY) { - my ($package, $symbol, $referent, $attr, $data) = @_; - $data = '' unless defined $data; - print STDERR ref($referent), ' ', *{$symbol}{NAME}, - " ($referent) was ascribed ${attr} with data ($data)\n"; -}; - -1; diff --git a/lib/Attribute/Handlers/demo/Descriptions.pm b/lib/Attribute/Handlers/demo/Descriptions.pm deleted file mode 100755 index 023f6f7..0000000 --- a/lib/Attribute/Handlers/demo/Descriptions.pm +++ /dev/null @@ -1,25 +0,0 @@ -package Descriptions; -$VERSION = '1.00'; - -use Attribute::Handlers; - -my %name; - -sub name { - return $name{$_[2]}||*{$_[1]}{NAME}; -} - -sub UNIVERSAL::Name :ATTR { - $name{$_[2]} = $_[4]; -} - -sub UNIVERSAL::Purpose :ATTR { - print STDERR "Purpose of ", &name, " is $_[4]\n"; -} - -sub UNIVERSAL::Unit :ATTR { - print STDERR &name, " measured in $_[4]\n"; -} - - -1; diff --git a/lib/Attribute/Handlers/demo/MyClass.pm b/lib/Attribute/Handlers/demo/MyClass.pm deleted file mode 100755 index 079b2cc..0000000 --- a/lib/Attribute/Handlers/demo/MyClass.pm +++ /dev/null @@ -1,64 +0,0 @@ -package MyClass; -$VERSION = '1.00'; -use v5.6.0; -use base Attribute::Handlers; -no warnings 'redefine'; - - -sub Good : ATTR(SCALAR) { - my ($package, $symbol, $referent, $attr, $data) = @_; - - # Invoked for any scalar variable with a :Good attribute, - # provided the variable was declared in MyClass (or - # a derived class) or typed to MyClass. - - # Do whatever to $referent here (executed in CHECK phase). - local $" = ", "; - print "MyClass::Good:ATTR(SCALAR)(@_);\n"; -}; - -sub Bad : ATTR(SCALAR) { - # Invoked for any scalar variable with a :Bad attribute, - # provided the variable was declared in MyClass (or - # a derived class) or typed to MyClass. - local $" = ", "; - print "MyClass::Bad:ATTR(SCALAR)(@_);\n"; -} - -sub Good : ATTR(ARRAY) { - # Invoked for any array variable with a :Good attribute, - # provided the variable was declared in MyClass (or - # a derived class) or typed to MyClass. - local $" = ", "; - print "MyClass::Good:ATTR(ARRAY)(@_);\n"; -}; - -sub Good : ATTR(HASH) { - # Invoked for any hash variable with a :Good attribute, - # provided the variable was declared in MyClass (or - # a derived class) or typed to MyClass. - local $" = ", "; - print "MyClass::Good:ATTR(HASH)(@_);\n"; -}; - -sub Ugly : ATTR(CODE) { - # Invoked for any subroutine declared in MyClass (or a - # derived class) with an :Ugly attribute. - local $" = ", "; - print "MyClass::UGLY:ATTR(CODE)(@_);\n"; -}; - -sub Omni : ATTR { - # Invoked for any scalar, array, hash, or subroutine - # with an :Omni attribute, provided the variable or - # subroutine was declared in MyClass (or a derived class) - # or the variable was typed to MyClass. - # Use ref($_[2]) to determine what kind of referent it was. - local $" = ", "; - my $type = ref $_[2]; - print "MyClass::OMNI:ATTR($type)(@_);\n"; - use Data::Dumper 'Dumper'; - print Dumper [ \@_ ]; -}; - -1; diff --git a/lib/Attribute/Handlers/demo/demo.pl b/lib/Attribute/Handlers/demo/demo.pl deleted file mode 100755 index 7a269e8..0000000 --- a/lib/Attribute/Handlers/demo/demo.pl +++ /dev/null @@ -1,31 +0,0 @@ -#! /usr/local/bin/perl -w - -use v5.6.0; -use base Demo; - -my $y : Demo :This($this) = sub : Demo(1,2,3) {}; -sub x : Demo(4, 5, 6) :Multi {} -my %z : Demo(hash) :Multi(method,maybe); -# my %a : NDemo(hash); - -{ - package Named; - - use base Demo; - - sub Demo :ATTR(SCALAR) { print STDERR "tada\n" } - - my $y : Demo :This($this) = sub : Demo(1,2,3) {}; - sub x : ExplMulti :Demo(4,5,6) {} - my %z : ExplMulti :Demo(hash); - my Named $q : Demo; -} - -package Other; - -my Demo $dother : Demo :This($this) = "okay"; -my Named $nother : Demo :This($this) = "okay"; - -# my $unnamed : Demo; - -# sub foo : Demo(); diff --git a/lib/Attribute/Handlers/demo/demo2.pl b/lib/Attribute/Handlers/demo/demo2.pl deleted file mode 100755 index 387ab44..0000000 --- a/lib/Attribute/Handlers/demo/demo2.pl +++ /dev/null @@ -1,21 +0,0 @@ -#! /usr/local/bin/perl -w - -use v5.6.0; -use base Demo; -no warnings 'redefine'; - -my %z1 :Multi(method?maybe); -my %z2 :Multi(method,maybe); -my %z3 :Multi(qw(method,maybe)); -my %z4 :Multi(qw(method maybe)); -my %z5 :Multi('method','maybe'); - -sub foo :Demo(till=>ears=>are=>bleeding) {} -sub foo :Demo(['till','ears','are','bleeding']) {} -sub foo :Demo(qw/till ears are bleeding/) {} -sub foo :Demo(till,ears,are,bleeding) {} - -sub foo :Demo(my,ears,are,bleeding) {} -sub foo :Demo(my=>ears=>are=>bleeding) {} -sub foo :Demo(qw/my, ears, are, bleeding/) {} -sub foo :Demo(qw/my ears are bleeding) {} diff --git a/lib/Attribute/Handlers/demo/demo3.pl b/lib/Attribute/Handlers/demo/demo3.pl deleted file mode 100755 index 6760fc0..0000000 --- a/lib/Attribute/Handlers/demo/demo3.pl +++ /dev/null @@ -1,16 +0,0 @@ -package main; -use MyClass; - -my MyClass $x :Good :Bad(1**1-1) :Omni(vorous); - -package SomeOtherClass; -use base MyClass; - -sub tent { 'acle' } - -sub w :Ugly(sister) :Omni('po',tent()) {} - -my @y :Good :Omni(s/cie/nt/); - -my %y :Good(q/bye) :Omni(q/bus/); - diff --git a/lib/Attribute/Handlers/demo/demo4.pl b/lib/Attribute/Handlers/demo/demo4.pl deleted file mode 100755 index 22d9fd9..0000000 --- a/lib/Attribute/Handlers/demo/demo4.pl +++ /dev/null @@ -1,9 +0,0 @@ -use Descriptions; - -my $capacity : Name(capacity) - : Purpose(to store max storage capacity for files) - : Unit(Gb); - -package Other; - -sub foo : Purpose(to foo all data before barring it) { } diff --git a/lib/Attribute/Handlers/demo/demo_call.pl b/lib/Attribute/Handlers/demo/demo_call.pl deleted file mode 100755 index 1a97342..0000000 --- a/lib/Attribute/Handlers/demo/demo_call.pl +++ /dev/null @@ -1,11 +0,0 @@ -#! /usr/local/bin/perl -w - -use Attribute::Handlers; - -sub Call : ATTR { - use Data::Dumper 'Dumper'; - print Dumper [ @_ ]; -} - - -sub x : Call(some,data) { }; diff --git a/lib/Attribute/Handlers/demo/demo_chain.pl b/lib/Attribute/Handlers/demo/demo_chain.pl deleted file mode 100755 index 8999c1c..0000000 --- a/lib/Attribute/Handlers/demo/demo_chain.pl +++ /dev/null @@ -1,27 +0,0 @@ -#! /usr/local/bin/perl -w - -use Attribute::Handlers; - -sub Prefix : ATTR { - my ($glob, $sub) = @_[1,2]; - no warnings 'redefine'; - *$glob = sub { - print "This happens first\n"; - $sub->(@_); - }; -} - -sub Postfix : ATTR { - my ($glob, $sub) = @_[1,2]; - no warnings 'redefine'; - *$glob = sub { - $sub->(@_); - print "This happens last\n"; - }; -} - -sub test : Postfix Prefix { - print "Hello World\n"; -} - -test(); diff --git a/lib/Attribute/Handlers/demo/demo_cycle.pl b/lib/Attribute/Handlers/demo/demo_cycle.pl deleted file mode 100755 index 5f307a7..0000000 --- a/lib/Attribute/Handlers/demo/demo_cycle.pl +++ /dev/null @@ -1,25 +0,0 @@ -package Selfish; - -sub TIESCALAR { - use Data::Dumper 'Dumper'; - print Dumper [ \@_ ]; - bless [ @_[1..$#_] ], $_[0]; -} - -sub FETCH { - use Data::Dumper 'Dumper'; - Dumper [ @{$_[0]} ]; -} - -package main; - -use Attribute::Handlers autotieref => { Selfish => Selfish }; - -my $next : Selfish("me"); -print "$next\n"; - -my $last : Selfish("you","them","who?"); -print "$last\n"; - -my $other : Selfish(["you","them","who?"]); -print "$other\n"; diff --git a/lib/Attribute/Handlers/demo/demo_hashdir.pl b/lib/Attribute/Handlers/demo/demo_hashdir.pl deleted file mode 100755 index 75e252b..0000000 --- a/lib/Attribute/Handlers/demo/demo_hashdir.pl +++ /dev/null @@ -1,9 +0,0 @@ -use Attribute::Handlers autotie => { Dir => 'Tie::Dir qw(DIR_UNLINK)' }; - -my %dot : Dir('.', DIR_UNLINK); - -print join "\n", keys %dot; - -delete $dot{killme}; - -print join "\n", keys %dot; diff --git a/lib/Attribute/Handlers/demo/demo_phases.pl b/lib/Attribute/Handlers/demo/demo_phases.pl deleted file mode 100755 index 022f7e1..0000000 --- a/lib/Attribute/Handlers/demo/demo_phases.pl +++ /dev/null @@ -1,18 +0,0 @@ -#! /usr/local/bin/perl -w - -use Attribute::Handlers; -use Data::Dumper 'Dumper'; - -sub UNIVERSAL::Beginner : ATTR(SCALAR,BEGIN,END) - { print STDERR "Beginner: ", Dumper \@_} - -sub UNIVERSAL::Checker : ATTR(CHECK,SCALAR) - { print STDERR "Checker: ", Dumper \@_} - -sub UNIVERSAL::Initer : ATTR(SCALAR,INIT) - { print STDERR "Initer: ", Dumper \@_} - -package Other; - -my $x :Initer(1) :Checker(2) :Beginner(3); -my $y :Initer(4) :Checker(5) :Beginner(6); diff --git a/lib/Attribute/Handlers/demo/demo_range.pl b/lib/Attribute/Handlers/demo/demo_range.pl deleted file mode 100755 index b63d518..0000000 --- a/lib/Attribute/Handlers/demo/demo_range.pl +++ /dev/null @@ -1,21 +0,0 @@ -package UNIVERSAL; -use Attribute::Handlers; -use Tie::RangeHash; - -sub Ranged : ATTR(HASH) { - my ($package, $symbol, $referent, $attr, $data) = @_; - tie %$referent, 'Tie::RangeHash'; -} - -package main; - -my %next : Ranged; - -$next{'cat,dog'} = "animal"; -$next{'fish,fowl'} = "meal"; -$next{'heaven,hell'} = "reward"; - -while (<>) { - chomp; - print $next{$_}||"???", "\n"; -} diff --git a/lib/Attribute/Handlers/demo/demo_rawdata.pl b/lib/Attribute/Handlers/demo/demo_rawdata.pl deleted file mode 100755 index c0754f0..0000000 --- a/lib/Attribute/Handlers/demo/demo_rawdata.pl +++ /dev/null @@ -1,12 +0,0 @@ -package UNIVERSAL; -use Attribute::Handlers; - -sub Cooked : ATTR(SCALAR) { print pop, "\n" } -sub PostRaw : ATTR(SCALAR,RAWDATA) { print pop, "\n" } -sub PreRaw : ATTR(SCALAR,RAWDATA) { print pop, "\n" } - -package main; - -my $x : Cooked(1..5); -my $y : PreRaw(1..5); -my $z : PostRaw(1..5); diff --git a/lib/Attribute/Handlers/t/multi.t b/lib/Attribute/Handlers/t/multi.t deleted file mode 100644 index 773606d..0000000 --- a/lib/Attribute/Handlers/t/multi.t +++ /dev/null @@ -1,131 +0,0 @@ -END {print "not ok 1\n" unless $loaded;} -use v5.6.0; -use Attribute::Handlers; -$loaded = 1; - -CHECK { $main::phase++ } - -######################### End of black magic. - -# Insert your test code below (better if it prints "ok 13" -# (correspondingly "not ok 13") depending on the success of chunk 13 -# of the test code): - -sub ok { $::count++; push @::results, [$_[1], $_[0]?"":"not "]; } - -END { print "1..$::count\n"; - print map "$_->[1]ok $_->[0]\n", - sort {$a->[0]<=>$b->[0]} - grep $_->[0], @::results } - -package Test; -use warnings; -no warnings 'redefine'; - -sub UNIVERSAL::Lastly :ATTR(INIT) { ::ok $_[4][0] && $main::phase, $_[4][1] } - -sub UNIVERSAL::Okay :ATTR(BEGIN) { ::ok $_[4][0] && !$main::phase, $_[4][1] } - -sub Dokay :ATTR(SCALAR) { ::ok @{$_[4]} } -sub Dokay :ATTR(HASH) { ::ok @{$_[4]} } -sub Dokay :ATTR(ARRAY) { ::ok @{$_[4]} } -sub Dokay :ATTR(CODE) { ::ok @{$_[4]} } - -sub Vokay :ATTR(VAR) { ::ok @{$_[4]} } - -sub Aokay :ATTR(ANY) { ::ok @{$_[4]} } - -package main; -use warnings; - -my $x1 :Lastly(1,41); -my @x1 :Lastly(1=>42); -my %x1 :Lastly(1,43); -sub x1 :Lastly(1,44) {} - -my Test $x2 :Dokay(1,5); - -package Test; -my $x3 :Dokay(1,6); -my Test $x4 :Dokay(1,7); -sub x3 :Dokay(1,8) {} - -my $y1 :Okay(1,9); -my @y1 :Okay(1,10); -my %y1 :Okay(1,11); -sub y1 :Okay(1,12) {} - -my $y2 :Vokay(1,13); -my @y2 :Vokay(1,14); -my %y2 :Vokay(1,15); -# BEGIN {eval 'sub y2 :Vokay(0,16) {}; 1' or -::ok(1,16); -# } - -my $z :Aokay(1,17); -my @z :Aokay(1,18); -my %z :Aokay(1,19); -sub z :Aokay(1,20) {}; - -package DerTest; -use base 'Test'; -use warnings; - -my $x5 :Dokay(1,21); -my Test $x6 :Dokay(1,22); -sub x5 :Dokay(1,23); - -my $y3 :Okay(1,24); -my @y3 :Okay(1,25); -my %y3 :Okay(1,26); -sub y3 :Okay(1,27) {} - -package Unrelated; - -my $x11 :Okay(1,1); -my @x11 :Okay(1=>2); -my %x11 :Okay(1,3); -sub x11 :Okay(1,4) {} - -BEGIN { eval 'my $x7 :Dokay(0,28)' or ::ok(1,28); } -my Test $x8 :Dokay(1,29); -eval 'sub x7 :Dokay(0,30) {}' or ::ok(1,30); - - -package Tie::Loud; - -sub TIESCALAR { ::ok(1,31); bless {}, $_[0] } -sub FETCH { ::ok(1,32); return 1 } -sub STORE { ::ok(1,33); return 1 } - -package Tie::Noisy; - -sub TIEARRAY { ::ok(1,$_[1]); bless {}, $_[0] } -sub FETCH { ::ok(1,35); return 1 } -sub STORE { ::ok(1,36); return 1 } -sub FETCHSIZE { 100 } - -package Tie::Row::dy; - -sub TIEHASH { ::ok(1,$_[1]); bless {}, $_[0] } -sub FETCH { ::ok(1,38); return 1 } -sub STORE { ::ok(1,39); return 1 } - -package main; - -eval 'sub x7 :ATTR(SCALAR) :ATTR(CODE) {}' and ::ok(0,40) or ::ok(1,40); - -use Attribute::Handlers autotie => { Other::Loud => Tie::Loud, - Noisy => Tie::Noisy, - UNIVERSAL::Rowdy => Tie::Row::dy, - }; - -my Other $loud : Loud; -$loud++; - -my @noisy : Noisy(34); -$noisy[0]++; - -my %rowdy : Rowdy(37,'this arg should be ignored'); -$rowdy{key}++; - diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 7c1ddd9..d682460 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -456,22 +456,6 @@ simply B. =item * -C allows a class to define attribute handlers. - - package MyPack; - use Attribute::Handlers; - sub Wolf :ATTR(SCALAR) { print "howl!\n" } - - # later, in some package using or inheriting from MyPack... - - my MyPack $Fluffy : Wolf; # the attribute handler Wolf will be called - -Both variables and routines can have attribute handlers. Handlers can -be specific to type (SCALAR, ARRAY, HASH, or CODE), or specific to the -exact compilation phase (BEGIN, CHECK, INIT, or END). - -=item * - B is a new compiler backend for walking the Perl syntax tree, printing concise info about ops, from Stephen McCamant. The output is highly customisable. See L. diff --git a/pod/perlmodlib.pod b/pod/perlmodlib.pod index 64bd9b4..5da2564 100644 --- a/pod/perlmodlib.pod +++ b/pod/perlmodlib.pod @@ -141,10 +141,6 @@ Restrict unsafe constructs Predeclare sub names -=item threads - -Perl extension allowing use of interpreter based threads from perl - =item utf8 Enable/disable UTF-8 (or UTF-EBCDIC) in source code @@ -179,10 +175,6 @@ Exporter module. See their own documentation for details. Provide framework for multiple DBMs -=item Attribute::Handlers - -Simpler definition of attribute handlers - =item AutoLoader Load subroutines only on demand diff --git a/pod/perltoc.pod b/pod/perltoc.pod index 81e202c..a02f0c9 100644 --- a/pod/perltoc.pod +++ b/pod/perltoc.pod @@ -2494,41 +2494,40 @@ module (sometimes unnecessary), B the module attributes, attrs, autouse, base, blib, bytes, charnames, constant, diagnostics, encoding, fields, filetest, integer, less, locale, open, ops, -overload, re, sigtrap, sort, strict, subs, threads, utf8, vars, vmsish, -warnings, warnings::register +overload, re, sigtrap, sort, strict, subs, utf8, vars, vmsish, warnings, +warnings::register =item Standard Modules -AnyDBM_File, Attribute::Handlers, AutoLoader, AutoSplit, B, B::Asmdata, -B::Assembler, B::Bblock, B::Bytecode, B::C, B::CC, B::Concise, B::Debug, -B::Deparse, B::Disassembler, B::Lint, B::Showlex, B::Stackobj, B::Stash, -B::Terse, B::Xref, Benchmark, ByteLoader, CGI, CGI::Apache, CGI::Carp, -CGI::Cookie, CGI::Fast, CGI::Pretty, CGI::Push, CGI::Switch, CGI::Util, -CPAN, CPAN::FirstTime, CPAN::Nox, Carp, Carp::Heavy, Class::ISA, -Class::Struct, Cwd, DB, DB_File, Devel::SelfStubber, Digest, DirHandle, -Dumpvalue, Encode, Encode::EncodeFormat, Encode::Tcl, English, Env, -Exporter, Exporter::Heavy, ExtUtils::Command, ExtUtils::Constant, -ExtUtils::Embed, ExtUtils::Install, ExtUtils::Installed, ExtUtils::Liblist, -ExtUtils::MM_Cygwin, ExtUtils::MM_NW5, ExtUtils::MM_OS2, ExtUtils::MM_Unix, -ExtUtils::MM_VMS, ExtUtils::MM_Win32, ExtUtils::MakeMaker, -ExtUtils::Manifest, ExtUtils::Mkbootstrap, ExtUtils::Mksymlists, -ExtUtils::Packlist, ExtUtils::testlib, Fatal, Fcntl, File::Basename, -File::CheckTree, File::Compare, File::Copy, File::DosGlob, File::Find, -File::Path, File::Spec, File::Spec::Epoc, File::Spec::Functions, -File::Spec::Mac, File::Spec::OS2, File::Spec::Unix, File::Spec::VMS, -File::Spec::Win32, File::Temp, File::stat, FileCache, FileHandle, -Filter::Simple, FindBin, Getopt::Long, Getopt::Std, I18N::Collate, -I18N::LangTags, I18N::LangTags::List, IO, IPC::Open2, IPC::Open3, -Locale::Constants, Locale::Country, Locale::Currency, Locale::Language, -Locale::Maketext, Locale::Maketext::TPJ13, Math::BigFloat, Math::BigInt, -Math::BigInt::Calc, Math::Complex, Math::Trig, Memoize, -Memoize::AnyDBM_File, Memoize::Expire, Memoize::ExpireFile, -Memoize::ExpireTest, Memoize::NDBM_File, Memoize::SDBM_File, -Memoize::Saves, Memoize::Storable, NDBM_File, NEXT, Net::Cmd, Net::Config, -Net::Domain, Net::FTP, Net::NNTP, Net::Netrc, Net::POP3, Net::Ping, -Net::SMTP, Net::Time, Net::hostent, Net::libnetFAQ, Net::netent, -Net::protoent, Net::servent, O, ODBM_File, Opcode, POSIX, PerlIO, -Pod::Checker, Pod::Find, Pod::Html, Pod::InputObjects, Pod::LaTeX, +AnyDBM_File, AutoLoader, AutoSplit, B, B::Asmdata, B::Assembler, B::Bblock, +B::Bytecode, B::C, B::CC, B::Concise, B::Debug, B::Deparse, +B::Disassembler, B::Lint, B::Showlex, B::Stackobj, B::Stash, B::Terse, +B::Xref, Benchmark, ByteLoader, CGI, CGI::Apache, CGI::Carp, CGI::Cookie, +CGI::Fast, CGI::Pretty, CGI::Push, CGI::Switch, CGI::Util, CPAN, +CPAN::FirstTime, CPAN::Nox, Carp, Carp::Heavy, Class::ISA, Class::Struct, +Cwd, DB, DB_File, Devel::SelfStubber, Digest, DirHandle, Dumpvalue, Encode, +Encode::EncodeFormat, Encode::Tcl, English, Env, Exporter, Exporter::Heavy, +ExtUtils::Command, ExtUtils::Constant, ExtUtils::Embed, ExtUtils::Install, +ExtUtils::Installed, ExtUtils::Liblist, ExtUtils::MM_Cygwin, +ExtUtils::MM_NW5, ExtUtils::MM_OS2, ExtUtils::MM_Unix, ExtUtils::MM_VMS, +ExtUtils::MM_Win32, ExtUtils::MakeMaker, ExtUtils::Manifest, +ExtUtils::Mkbootstrap, ExtUtils::Mksymlists, ExtUtils::Packlist, +ExtUtils::testlib, Fatal, Fcntl, File::Basename, File::CheckTree, +File::Compare, File::Copy, File::DosGlob, File::Find, File::Path, +File::Spec, File::Spec::Epoc, File::Spec::Functions, File::Spec::Mac, +File::Spec::OS2, File::Spec::Unix, File::Spec::VMS, File::Spec::Win32, +File::Temp, File::stat, FileCache, FileHandle, Filter::Simple, FindBin, +Getopt::Long, Getopt::Std, I18N::Collate, I18N::LangTags, +I18N::LangTags::List, IO, IPC::Open2, IPC::Open3, Locale::Constants, +Locale::Country, Locale::Currency, Locale::Language, Locale::Maketext, +Locale::Maketext::TPJ13, Math::BigFloat, Math::BigInt, Math::BigInt::Calc, +Math::Complex, Math::Trig, Memoize, Memoize::AnyDBM_File, Memoize::Expire, +Memoize::ExpireFile, Memoize::ExpireTest, Memoize::NDBM_File, +Memoize::SDBM_File, Memoize::Saves, Memoize::Storable, NDBM_File, NEXT, +Net::Cmd, Net::Config, Net::Domain, Net::FTP, Net::NNTP, Net::Netrc, +Net::POP3, Net::Ping, Net::SMTP, Net::Time, Net::hostent, Net::libnetFAQ, +Net::netent, Net::protoent, Net::servent, O, ODBM_File, Opcode, POSIX, +PerlIO, Pod::Checker, Pod::Find, Pod::Html, Pod::InputObjects, Pod::LaTeX, Pod::Man, Pod::ParseLink, Pod::ParseUtils, Pod::Parser, Pod::Plainer, Pod::Select, Pod::Text, Pod::Text::Color, Pod::Text::Overstrike, Pod::Text::Termcap, Pod::Usage, Pod::t::basic, SDBM_File, Safe, @@ -8476,58 +8475,6 @@ C, C, C =back -=head2 threads - Perl extension allowing use of interpreter based threads -from perl - -=over 4 - -=item SYNOPSIS - -=item DESCRIPTION - -$thread = new(function, LIST), $thread->join, $thread->detach, -threads->self, $thread->tid - -=item TODO - -Fix so the return value is returned when you join, Add join_all, Fix memory -leaks! - -=item AUTHOR and COPYRIGHT - -=item BUGS - -creating a thread from within a thread is unsafe under win32, -PERL_OLD_SIGNALS are not threadsafe, will not be - -=item SEE ALSO - -=back - -=head2 threadshared, threads::shared - Perl extension for sharing data -structures between threads - -=over 4 - -=item SYNOPSIS - -=item DESCRIPTION - -=item EXPORT - -=item FUNCTIONS - -share VARIABLE, lock VARIABLE, unlock VARIABLE, cond_wait VARIABLE, -cond_signal VARIABLE, cond_broadcast VARIABLE - -=item BUGS - -=item AUTHOR - -=item SEE ALSO - -=back - =head2 utf8 - Perl pragma to enable/disable UTF-8 (or UTF-EBCDIC) in source code @@ -8620,49 +8567,6 @@ warnings::warnif($object, $message) =back -=head2 Attribute::Handlers - Simpler definition of attribute handlers - -=over 4 - -=item VERSION - -=item SYNOPSIS - -=item DESCRIPTION - -[0], [1], [2], [3], [4], [5] - -=over 4 - -=item Typed lexicals - -=item Type-specific attribute handlers - -=item Non-interpretive attribute handlers - -=item Phase-specific attribute handlers - -=item Attributes as C interfaces - -=back - -=item EXAMPLES - -=item DIAGNOSTICS - -C, C, C, C, -C, C - -=item AUTHOR - -=item BUGS - -=item COPYRIGHT - -=back - =head2 AutoLoader - load subroutines only on demand =over 4