use strict; use warnings; use feature 'say'; use Mojo::DOM; my $html = ''; my $dom = Mojo::DOM->new( $html ); # find each select foreach my $select ( $dom->find('select')->each ){ say "Found select named $select->{name} with the values/text:"; # process each option foreach my $opt ( $select->find('option')->each ){ say $opt->{value}; say $opt->text; } }