Yes it can. Perl doesn't have some check buildin in to
see if it was spawned from an MTA, and if it is, to not
run. In other words, Perl doesn't care who called it.
If you get errors, it's probably something you configured
wrong in your MTA configuration.