sub class_own { my ($movie,$season) = @_; warn "class_own: $movie not in database" if !$movies{$movie}; my ($trash,$raw_season_num) = split(/ /,$season) if $season; my $season_num = $raw_season_num + 0 if $raw_season_num; for my $type_seasons ( split /;/, $movies{$movie}{format} ) { my ($type,$seasons) = split(/:/,$type_seasons); my @seasons = $seasons ? eval($seasons) : (); if (($type and !$season) || (grep( $_ == $season_num, @seasons))) { return qq( $type); } } return 'none'; }