From: Gurusamy Sarathy Date: Tue, 22 Feb 2000 16:48:58 +0000 (+0000) Subject: remove vestiges of older attribute syntax X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=da2094fd55cfc73caee2f71b349588c60a542297;p=p5sagit%2Fp5-mst-13.2.git remove vestiges of older attribute syntax p4raw-id: //depot/perl@5202 --- diff --git a/ext/attrs/attrs.pm b/ext/attrs/attrs.pm index f744e36..2070632 100644 --- a/ext/attrs/attrs.pm +++ b/ext/attrs/attrs.pm @@ -20,7 +20,7 @@ attrs - set/get attributes of a subroutine (deprecated) NOTE: Use of this pragma is deprecated. Use the syntax - sub foo : locked, method { } + sub foo : locked method { } to declare attributes instead. See also L. diff --git a/pod/Win32.pod b/pod/Win32.pod index 08043e8..37c5cbd 100644 --- a/pod/Win32.pod +++ b/pod/Win32.pod @@ -132,8 +132,8 @@ same value. =item Win32::GetLongPathName(PATHNAME) -[CORE] Returns a representaion of PATHNAME comprised of longname -compnents (if any). The result may not necessarily be longer +[CORE] Returns a representaion of PATHNAME composed of longname +components (if any). The result may not necessarily be longer than PATHNAME. No attempt is made to convert PATHNAME to the absolute path. Compare with Win32::GetShortPathName and Win32::GetFullPathName. @@ -156,7 +156,7 @@ for Windows NT. In scalar context it returns just the ID. =item Win32::GetShortPathName(PATHNAME) -[CORE] Returns a representation of PATHNAME comprised only of +[CORE] Returns a representation of PATHNAME composed only of short (8.3) path components. The result may not necessarily be shorter than PATHNAME. Compare with Win32::GetFullPathName and Win32::GetLongPathName. diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 746c242..f9e9f04 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -461,7 +461,7 @@ variables. See L. =head2 Support for strings represented as a vector of ordinals -Literals of the form v1.2.3.4 are now parsed as a string comprised of +Literals of the form v1.2.3.4 are now parsed as a string composed of of characters with the specified ordinals. This is an alternative, more readable way to construct (possibly unicode) strings instead of interpolating characters, as in C<"\x{1}\x{2}\x{3}\x{4}">. @@ -861,7 +861,7 @@ only during normal running are warranted. See L. =head2 New variable $^V contains Perl version in v5.6.0 format -C<$^V> contains the Perl version number as a string comprised of +C<$^V> contains the Perl version number as a string composed of characters whose ordinals match the version numbers, so that it may be used in string comparisons. diff --git a/pod/perlop.pod b/pod/perlop.pod index 1512412..7cb3450 100644 --- a/pod/perlop.pod +++ b/pod/perlop.pod @@ -1804,7 +1804,7 @@ in a bit vector. =head2 Strings of Character -A literal of the form C is parsed as a string comprised +A literal of the form C is parsed as a string composed of characters with the specified ordinals. This provides an alternative, more readable way to construct strings, rather than use the somewhat less readable interpolation form C<"\x{1}\x{14}\x{12c}\x{fa0}">. This is useful diff --git a/pod/perlthrtut.pod b/pod/perlthrtut.pod index fc88561..88849dd 100644 --- a/pod/perlthrtut.pod +++ b/pod/perlthrtut.pod @@ -722,8 +722,7 @@ subroutine's behavior while your program is actually running. The basic subroutine lock looks like this: - sub test_sub { - use attrs qw(locked); + sub test_sub :locked { } This ensures that only one thread will be executing this subroutine at @@ -738,8 +737,7 @@ it. A more elaborate example looks like this: new Thread \&thread_sub, 3; new Thread \&thread_sub, 4; - sub sync_sub { - use attrs qw(locked); + sub sync_sub :locked { my $CallingThread = shift @_; print "In sync_sub for thread $CallingThread\n"; yield; @@ -754,8 +752,8 @@ it. A more elaborate example looks like this: print "$ThreadID is done with sync_sub\n"; } -The use attrs qw(locked) locks sync_sub(), and if you run this, you -can see that only one thread is in it at any one time. +The C attribute tells perl to lock sync_sub(), and if you run +this, you can see that only one thread is in it at any one time. =head2 Methods @@ -793,8 +791,7 @@ method attribute indicates whether the subroutine is really a method. return bless [@_], $class; } - sub per_object { - use attrs qw(locked method); + sub per_object :locked :method { my ($class, $thrnum) = @_; print "In per_object for thread $thrnum\n"; yield; @@ -802,8 +799,7 @@ method attribute indicates whether the subroutine is really a method. print "Exiting per_object for thread $thrnum\n"; } - sub one_at_a_time { - use attrs qw(locked); + sub one_at_a_time :locked { my ($class, $thrnum) = @_; print "In one_at_a_time for thread $thrnum\n"; yield; @@ -817,8 +813,8 @@ thread is ever in one_at_a_time() at once. =head2 Locking A Subroutine -You can lock a subroutine as you would lock a variable. Subroutine -locks work the same as a C in the subroutine, +You can lock a subroutine as you would lock a variable. Subroutine locks +work the same as specifying a C attribute for the subroutine, and block all access to the subroutine for other threads until the lock goes out of scope. When the subroutine isn't locked, any number of threads can be in it at once, and getting a lock on a subroutine @@ -827,10 +823,10 @@ subroutine looks like this: lock(\&sub_to_lock); -Simple enough. Unlike use attrs, which is a compile time option, -locking and unlocking a subroutine can be done at runtime at your +Simple enough. Unlike the C attribute, which is a compile time +option, locking and unlocking a subroutine can be done at runtime at your discretion. There is some runtime penalty to using lock(\&sub) instead -of use attrs qw(locked), so make sure you're choosing the proper +of the C attribute, so make sure you're choosing the proper method to do the locking. You'd choose lock(\&sub) when writing modules and code to run on both diff --git a/pod/perlvar.pod b/pod/perlvar.pod index 947942c..6b4c659 100644 --- a/pod/perlvar.pod +++ b/pod/perlvar.pod @@ -911,7 +911,7 @@ and B<-C> filetests are based on this value. =item $^V The revision, version, and subversion of the Perl interpreter, represented -as a string comprised of characters with those ordinals. Thus in Perl v5.6.0 +as a string composed of characters with those ordinals. Thus in Perl v5.6.0 it equals C and will return true for C<$^V eq v5.6.0>. Note that the characters in this string value can potentially be in Unicode range.