Install Perl 5.8.8
[msysgit.git] / mingw / html / lib / attrs.html
blobb04237da0e7d14fcbdf0cdbf98e11bba5d86d05c
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>attrs - set/get attributes of a subroutine</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:" />
8 </head>
10 <body style="background-color: white">
11 <table border="0" width="100%" cellspacing="0" cellpadding="3">
12 <tr><td class="block" style="background-color: #cccccc" valign="middle">
13 <big><strong><span class="block">&nbsp;attrs - set/get attributes of a subroutine</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
22 <li><a href="#name">NAME</a></li>
23 <li><a href="#synopsis">SYNOPSIS</a></li>
24 <li><a href="#description">DESCRIPTION</a></li>
25 </ul>
26 <!-- INDEX END -->
28 <hr />
29 <p>
30 </p>
31 <h1><a name="name">NAME</a></h1>
32 <p>attrs - set/get attributes of a subroutine (deprecated)</p>
33 <p>
34 </p>
35 <hr />
36 <h1><a name="synopsis">SYNOPSIS</a></h1>
37 <pre>
38 sub foo {
39 use attrs qw(locked method);
40 ...
41 }</pre>
42 <pre>
43 @a = attrs::get(\&amp;foo);</pre>
44 <p>
45 </p>
46 <hr />
47 <h1><a name="description">DESCRIPTION</a></h1>
48 <p>NOTE: Use of this pragma is deprecated. Use the syntax</p>
49 <pre>
50 sub foo : locked method { }</pre>
51 <p>to declare attributes instead. See also <a href="file://C|\msysgit\mingw\html/lib/attributes.html">the attributes manpage</a>.</p>
52 <p>This pragma lets you set and get attributes for subroutines.
53 Setting attributes takes place at compile time; trying to set
54 invalid attribute names causes a compile-time error. Calling
55 <code>attrs::get</code> on a subroutine reference or name returns its list
56 of attribute names. Notice that <code>attrs::get</code> is not exported.
57 Valid attributes are as follows.</p>
58 <dl>
59 <dt><strong><a name="item_method">method</a></strong>
61 <dd>
62 <p>Indicates that the invoking subroutine is a method.</p>
63 </dd>
64 </li>
65 <dt><strong><a name="item_locked">locked</a></strong>
67 <dd>
68 <p>Setting this attribute is only meaningful when the subroutine or
69 method is to be called by multiple threads. When set on a method
70 subroutine (i.e. one marked with the <strong>method</strong> attribute above),
71 perl ensures that any invocation of it implicitly locks its first
72 argument before execution. When set on a non-method subroutine,
73 perl ensures that a lock is taken on the subroutine itself before
74 execution. The semantics of the lock are exactly those of one
75 explicitly taken with the <code>lock</code> operator immediately after the
76 subroutine is entered.</p>
77 </dd>
78 </li>
79 </dl>
80 <table border="0" width="100%" cellspacing="0" cellpadding="3">
81 <tr><td class="block" style="background-color: #cccccc" valign="middle">
82 <big><strong><span class="block">&nbsp;attrs - set/get attributes of a subroutine</span></strong></big>
83 </td></tr>
84 </table>
86 </body>
88 </html>