Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
make a working example
  • Loading branch information
tbrowder committed May 23, 2016
1 parent de581cb commit b9efb74
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions doc/Language/variables.pod
Expand Up @@ -941,12 +941,26 @@ match and so usually contains objects of type L<Match>.
say $/.Str; # abc
The C<Grammar.parse> method also sets the caller's C<$/> to the resulting
L<Match> object.
L<Match> object. For the following code:
use XML;
XML.parse(slurp "filename.xml")
use XML::Grammar; # panda install XML
XML.Grammar.parse("<p>some text</p>");
say $/;
the output is:
「<p>some text</p>」
root => 「<p>some text</p>」
name => 「p」
child => 「some text」
text => 「some text」
textnode => 「some text」
element => 「<p>some text</p>」
name => 「p」
child => 「some text」
text => 「some text」
textnode => 「some text」
=head4 X«Positional Attributes|variable,$0;variable,$1;variable,@()»
C<$/> can have positional attributes if the L<Regex|regex> had
Expand Down

0 comments on commit b9efb74

Please sign in to comment.