From command line with imagemagick, you can use:
convert dragon.gif -resize 64x64^ -gravity center -extent 64x64 fill_crop_dragon.gif
to resize and then crop an image so that it fills the area as much as possible.
How do I do this from Perl's Image::Magick?
See the PerlMagick documentation.