Net::Pavatar - Pavatar client


Version 1.01


    use Net::Pavatar;

    my ($hash, $file_type) = Net::Pavatar->fetch( '', { size => [32, 48] } );

    if ($file_type) {
        open FILE, ">avatar.$file_type";
        print FILE $hash->{'48'};
        close FILE;


Fetches a pavatar image from a given URL and gives it to you in the sizes you specify. Uses LWPx::ParanoidAgent to protect your servers from attacks.

This module fully conforms to Pavatar spec 0.3.0 (, which is the latest one on Apr 25th, 2007.


my ($hashref, $type) = Net::Pavatar->fetch( $url, \%opts )

Returns a hashref and a string, as a 2-list. The hash contains the image sizes as keys, and the image data for each size as values. The string contains the image type and can either be 'jpeg', 'png' or 'gif'. If a pavatar does not exist, or is not valid for any reason, returns null.

The \%opts hashref is optional, and accepts the following keys:

size : the sizes that you want the pavatar image returned in - defaults to 80

timeout : the total time that UserAgent is allowed to retrieve each page or image - defaults to 15

e.g. Net::Pavatar->fetch( $url, { size => [32, 48], timeout => 25 } )


Alexander Karelas, <karjala at>


Please report any bugs or feature requests to bug-net-pavatar 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 Net::Pavatar

You can also look for information at:



Copyright 2007 Alexander Karelas, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.