in reply to uploading a data:image/imagetype,base64 in perl

Maybe there is some other data in front of the data you fetch from ->param('imagedata')?

Maybe save the raw base64 data to a file first and have a look at it?

MIME::Base64 doesn't document any kind of error handling, so I would look at the raw data coming in first.