How to integrate a perl script?

A friend wrote a quick perl script to add an image’s dimensions to the file name. How can I incorporate this into Automator?

My attemps have ended in Workflow Execution Failed… I know I’m not even really that close anyway. I just popped it into a Run Shell Script step and put an image in a Get Specificed Finder Items step.