You may want to look at the ImageMagick libraries as well as PerlMagick (Image::Magick) to use them. Basically, of you use software that can create them, look to see if an interface to the API has been done in Perl. But, I have used PerlMagick to do some crude animated GIFs in the past.