Skip to content

Commit

Permalink
[variables] document the ? twigil
Browse files Browse the repository at this point in the history
  • Loading branch information
felher committed Aug 29, 2012
1 parent 6f41c1b commit 08d76c8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/variables.pod
Expand Up @@ -120,6 +120,23 @@ private and can be directly accessed within the class by using
C<$!attribute-name>. Perl 6 may automatically generate accessor methods for you
tough. For more details on objects, classes and their attributes see L<objects>.
=head2 ?
Compile-time "constants" may be addressed via the C<?> twigil. They are known to
the compiler and may not be modified after being compiled in. A popular example
for this is:
say "$?FILE: $?LINE"; # prints "hello.pl: 23" if this is the 23 line of a
# file named "hello.pl".
Although they may not be changed at runtime, the user is allowed to (re)define
such constants.
constant $?TABSTOP = 4; # this causes leading tabs in a heredoc or in a POD
# block's virtual margin to be counted as 4 spaces.
For a list of those special variables see L<Compile-time "constants">.
=head1 Special Variables
=head2 Often-Used Variables
Expand Down

0 comments on commit 08d76c8

Please sign in to comment.