@@ -11,8 +11,8 @@ followed optionally by a second special character named I<twigil> and then an
11
11
L<identifier|/language/syntax#Identifiers>.
12
12
13
13
14
- =head1 Sigils
15
14
X<|Syntax,$>X<|Syntax,@>X<|Syntax,% (sigil)>X<|Syntax,&>
15
+ =head1 Sigils
16
16
17
17
There are four sigils. The scalar-sigil C<$>, the positional-sigil C<@>, the
18
18
associative-sigil C<%> and the callable-sigil C<&>.
@@ -184,8 +184,8 @@ C<@array>, such that it becomes an Array with a single element, namely a List.
184
184
See L<operators|/language/operators> for more details on precedence and
185
185
associativity.
186
186
187
- =head2 Sigilless variables
188
187
X<|Syntax,\ (sigilless variables)>
188
+ =head2 Sigilless variables
189
189
190
190
Using the C<\> prefix, it's possible to create variables that do not
191
191
have a sigil:
@@ -240,10 +240,9 @@ variable, that is, where that variable is defined and can be changed.
240
240
241
241
=end table
242
242
243
- X<|Syntax,$*>
244
243
X<|Language,Dynamically scoped variables>
245
- =head2 The C<*> twigil
246
244
X<|Syntax,*>X<|Syntax,$*>X<|Syntax,@*>X<|Syntax,%*>X<|Syntax,&*>
245
+ =head2 The C<*> twigil
247
246
248
247
This twigil is used for dynamic variables which are looked up through the
249
248
caller's, not through the outer, scope. Look at the example below.N<The example
@@ -306,8 +305,8 @@ scope when declared with C<our>. Dynamic resolution and resolution through
306
305
symbol tables introduced with C<our> are two orthogonal issues.
307
306
308
307
309
- =head2 The C<?> twigil
310
308
X<|Syntax,$?>X<|Syntax,?>X<|Syntax,$?>X<|Syntax,@?>X<|Syntax,%?>X<|Syntax,&?>
309
+ =head2 The C<?> twigil
311
310
312
311
Compile-time variables may be addressed via the C<?> twigil. They are known
313
312
to the compiler and may not be modified after being compiled in. A popular
@@ -320,8 +319,8 @@ example for this is:
320
319
For a list of these special variables, see
321
320
L<compile-time variables|/language/variables#Compile-time_variables>.
322
321
323
- =head2 The C<!> twigil
324
322
X<|Syntax,!>X<|Syntax,$!>X<|Syntax,@!>X<|Syntax,%!>X<|Syntax,&!>
323
+ =head2 The C<!> twigil
325
324
326
325
L<Attributes|/language/objects#Attributes> are variables that exist per instance
327
326
of a class. They may be directly accessed from within the class via C<!>:
@@ -343,8 +342,8 @@ you though. For more details on objects, classes and their attributes see
343
342
L<object orientation|/language/objects>.
344
343
345
344
346
- =head2 The C<.> twigil
347
345
X<|Syntax,.>X<|Syntax,$.>X<|Syntax,@.>X<|Syntax,%.>X<|Syntax,&.>
346
+ =head2 The C<.> twigil
348
347
349
348
The C<.> twigil isn't really for variables at all. In fact, something along
350
349
the lines of
@@ -376,8 +375,8 @@ is also possible:
376
375
For more details on objects, classes and their attributes and methods see
377
376
L<object orientation|/language/objects>.
378
377
379
- =head2 The C<^> twigil
380
378
X<|Syntax,^>X<|Syntax,$^>X<|Syntax,@^>X<|Syntax,%^>X<|Syntax,&^>
379
+ =head2 The C<^> twigil
381
380
382
381
The C<^> twigil declares a formal positional parameter to blocks or subroutines;
383
382
that is, variables of the form C<$^variable> are a type of placeholder variable.
@@ -417,8 +416,8 @@ in the L<Sigils table|#Sigils>. Thus C<@^array>, C<%^hash>, and C<&^fun> are all
417
416
valid placeholder variables.
418
417
419
418
420
- =head2 The C<:> twigil
421
419
X<|Syntax,:>X<|Syntax,$:>X<|Syntax,@:>X<|Syntax,%:>X<|Syntax,&:>
420
+ =head2 The C<:> twigil
422
421
423
422
The C<:> twigil declares a formal named parameter to a block or subroutine.
424
423
Variables declared using this form are a type of placeholder variable too.
@@ -460,8 +459,8 @@ the L<semantics of that sigil|#Sigils>). Thus C<@:array>, C<%:hash>, and
460
459
C<&:fun> are all valid, and each creates a formal named parameter with the
461
460
specified sigil.
462
461
463
- =head2 The C<=> twigil
464
462
X<|Syntax,=>X<|Syntax,$=>X<|Syntax,@=>X<|Syntax,%=>X<|Syntax,&=>
463
+ =head2 The C<=> twigil
465
464
466
465
The C<=> twigil is used to access Pod variables. Every Pod block in the
467
466
current file can be accessed via a Pod object, such as C<$=data>,
@@ -481,8 +480,8 @@ hierarchical data structure through C<$=pod>.
481
480
Note that all those C<$=someBlockName> support the L<C<Positional>|/type/Positional> and the
482
481
L<C<Associative>|/type/Associative> roles.
483
482
484
- =head2 The C<~> twigil
485
483
X<|Syntax,$~>
484
+ =head2 The C<~> twigil
486
485
487
486
The C<~> twigil is for referring to sublanguages (called slangs). The
488
487
following are useful:
0 commit comments