Skip to content

Commit

Permalink
better Mojo::DOM examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jul 5, 2014
1 parent ead8245 commit 40bbf5d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

5.13 2014-07-05
5.13 2014-07-06

5.12 2014-07-04
- Fixed a few multipart form handling bugs.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/DOM.pm
Expand Up @@ -409,11 +409,11 @@ Mojo::DOM - Minimalistic HTML/XML DOM parser with CSS selectors
say $dom->div->children('p')->first->{id};
# Iterate
$dom->find('p[id]')->each(sub { say shift->{id} });
$dom->find('p[id]')->each(sub { say $_->{id} });
# Loop
for my $e ($dom->find('p[id]')->each) {
say $e->text;
say $e->{id}, ':', $e->text;
}
# Modify
Expand Down

0 comments on commit 40bbf5d

Please sign in to comment.