This manual page is for Mac OS X version 10.6.3

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • For more information about the manual page format, see the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Reference Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



attrs(3pm)                            Perl Programmers Reference Guide                            attrs(3pm)



NAME
       attrs - set/get attributes of a subroutine (deprecated)

SYNOPSIS
           sub foo {
               use attrs qw(locked method);
               ...
           }

           @a = attrs::get(\&foo);

DESCRIPTION
       NOTE: Use of this pragma is deprecated.  Use the syntax

           sub foo : locked method { }

       to declare attributes instead.  See also attributes.

       This pragma lets you set and get attributes for subroutines.  Setting attributes takes place at
       compile time; trying to set invalid attribute names causes a compile-time error. Calling "attrs::get"
       on a subroutine reference or name returns its list of attribute names. Notice that "attrs::get" is
       not exported.  Valid attributes are as follows.

       method
           Indicates that the invoking subroutine is a method.

       locked
           Setting this attribute is only meaningful when the subroutine or method is to be called by
           multiple threads. When set on a method subroutine (i.e. one marked with the method attribute
           above), perl ensures that any invocation of it implicitly locks its first argument before
           execution. When set on a non-method subroutine, perl ensures that a lock is taken on the
           subroutine itself before execution. The semantics of the lock are exactly those of one explicitly
           taken with the "lock" operator immediately after the subroutine is entered.



perl v5.10.0                                     2007-12-18                                       attrs(3pm)

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation to the Perl project. (See perlbug(1) for submission instructions.)
Bug reports
Report bugs in the functionality of the described tool or API to Apple through Bug Reporter and to the Perl project using perlbug(1).
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.

Did this document help you? Yes It's good, but... Not helpful...