The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


WWW::Moviepilot - Interface to the database


Version 0.04


    use WWW::Moviepilot;
    my $m = WWW::Moviepilot->new({
        api_key => ...,
        host    => '',

    # direct retrieval
    my $movie = $m->movie( 'matrix' );

    # search
    my @movies = $m->search_movie( 'matrix' );
    foreach my $movie ( @movies ) {
        print $movie->display_title;

    # cast of a movie
    my @cast = $m->cast( 'matrix' );
    foreach my $person ( @cast ) {
        print $person->last_name;
        print $person->character;

    # filmography of a person
    my @filmography = $m->filmography( 'paul-newman' );
    foreach my $movie ( @filmography ) {
        print $movie->display_title;
        print $movie->character;

Please note: This module is still in early development and subject to change.


new( $args )

Creates a new WWW::Moviepilot instance.

    my $m = WWW::Moviepilot->new( $args );

$args must be a hash reference, you should supply an API key:

    $args->{api_key} = ...;

To get a valid API key you should read

Further optional arguments:

  • host (default:

    The host where the requests are sent to.

  • ua (default: LWP::UserAgent->new)

    A LWP::UserAgent compatible user agent.

movie( $name ) | movie( $source => $id )

Retrieve a movie as WWW::Moviepilot::Movie object. There are two ways to specify which movie to retrieve. First, you can provide the name of the movie (this name is some kind of normalised, I'm not sure how exactly):

    my $movie = $m->movie( 'matrix' );

The second form is to provide an alternate ID:

    my $movie = $m->movie( imdb => '133093' );
    my $movie = $m->movie( amazon => 'B00004R80K' );

search_movie( $query )

Searches for a movie and returns a list with results:

    my @movielist = $m->search_movie( 'matrix' );
    if ( @movielist == 0 ) {
        print 'no movies found';
    else {
        # each $movie is a WWW::Moviepilot::Movie object
        foreach my $movie ( @movielist ) {
            print $movie->display_title;        # e.g. Matrix
            print $movie->production_year;      # e.g. 1999
            print scalar $movie->emotions_list; # e.g. Spannend,Aufregend

            # in list context, all *_list fields are split up by comma
            my @emotions = $movie->emotions_list;

At most there are 20 movies returned.

See WWW::Moviepilot::Movie.

person( $name )

Retrieve a person as WWW::Moviepilot::Person object. You should provide the name of the movie (this name is some kind of normalised, I'm not sure how exactly):

    my $person = $m->person( 'paul-newman' );

search_person( $query )

Searches for a person and returns a list with results:

    my @people = $m->search_person( 'Paul Newman' );
    if ( @people == 0 ) {
        print 'no people found';
    else {
        # each $person is a WWW::Moviepilot::Person object
        foreach my $person ( @person ) {
            print $person->first_name; # e.g. Paul
            print $person->last_name;  # e.g. Newman

See WWW::Moviepilot::Person.

cast( $name )

Returns the cast of a movie.

    my $m = WWW::Moviepilot->new(...);
    my @cast = $m->cast('brust-oder-keule');

See WWW::Moviepilot::Person.

filmography( $name )

Returns the filmography of a person.

    my $m = WWW::Moviepilot->new(...);
    my @filmography = $m->filmography('paul-newman');

See WWW::Moviepilot::Movie.


    my $api_key = $m->api_key;

Returns the API key provided to the new constructor.


    my $ua = $m->ua;

Returns the user agent, usually a LWP::UserAgent.


    my $host = $m->host;

Returns host which the requests are sent to provided to the new constructor.


The Moviepilot API Dokumentation at, WWW::Moviepilot::Movie, WWW::Moviepilot::Person, LWP::UserAgent.


Frank Wiegand, <frank.wiegand at>


Please report any bugs or feature requests to bug-www-moviepilot at, or through the web interface at I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.


You can find documentation for this module with the perldoc command.

    perldoc WWW::Moviepilot

You can also look for information at:


Thanks to the team for providing an API key for developing and testing this module.


Copyright 2009 Frank Wiegand.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See for more information.