Skip to content

Commit 64664a8

Browse files
authored
rearrange example with twigil $*x accordingly
1 parent 3c33cd4 commit 64664a8

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

doc/Type/Variable.rakudoc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@ dynamic variables. A much easier way is to use the C<* twigil>:
7777
sub introspect() {
7878
say $*x;
7979
}
80-
my $*x = 23;
81-
introspect; # OUTPUT: «23␤»
8280
{
83-
# not dynamic
84-
my $x;
85-
introspect() # dies with an exception of X::Dynamic::NotFound
81+
my $*x = 42;
82+
introspect(); # OUTPUT: «42␤»
83+
}
84+
{
85+
my $x = 41; # not dynamic
86+
introspect(); # dies with an exception of X::Dynamic::NotFound
8687
}
8788
=end code
8889

0 commit comments

Comments
 (0)