graphicsmagic: fix perl support

Closes #25689.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>