Good question. Read #6 of The Perl Artistic License. Basically, code fed to Perl is not covered under the same license as Perl itself. It's up to the author.
I have used one piece of purchased Perl software that encrypted this way. They only encrypted their code -- not modules provided by Perl; not modules written by others and pulled from CPAN.
As for the spirit ... depends on how much of an Open Source zealot you really are I guess. Certainly it would offend RMS. I'm less of a zealot so my spirt was not offended.