All pastes #365076 Raw Edit

Film.pm

public text v1 · immutable
#365076 ·published 2007-02-20 17:13 UTC
rendered paste body
sub certifications {
        my CLASS_NAME $self = shift;
        my $forced = shift || 0;
        my (%cert_list, $tag);

        if($forced) {
                my $parser = $self->_parser(FORCED);
                while($tag = $parser->get_tag('h5')) { #tag changed from b to h5
                        last if $parser->get_text =~ /certification/i;
                }

                while($tag = $parser->get_tag()) {

                        if($tag->[0] eq 'a' && $tag->[1]{href} =~ /certificates/i) {
                                my($country, $range) = split /\:/, $parser->get_text;
                                $cert_list{$country} = $range;
                        }

                        last if $tag->[0] eq '/div'; #changed from /td to /div
                }

                $self->{_certifications} = \%cert_list;
        }

        return $self->{_certifications};
}