Что мне нужно изменить в приведенном ниже примере, чтобы matches( 'a[rel="next"]' )
возвращал true
?
#!/usr/bin/env perl
use warnings;
use strict;
use Mojo::DOM;
my $content = '<html><body><div><a hello="world" rel="next">Next</a></div></body></html>';
my $bool_1 = $content =~ /<a.+?rel="next"/;
print "1 OK\n" if $bool_1;
my $dom = Mojo::DOM->new( $content );
my $bool_2 = $dom->matches( 'a[rel="next"]' );
print "2 OK\n" if $bool_2; # does not print "2 OK"