I'd guess this has something to do with the lack of any real environment to speak of under mod_perl. I will admit to only being familiar with mod_perl 1, however this does look like a bug of some sort (it works fine under mod_perl 1 using Apache::Registry and perl 5.6.1). To track it down, a few more specifics are needed.
How do you have mod_perl set up (some bits of your apache config might be useful)? What version of perl is mod_perl using?
PS -- You say that this is being called "as a CGI under mod_perl," which is a bit of an oxymoron -- either you run programs molasses-slow under CGI, or you're using the accelerated features of mod_perl. You can't be doing both -- from Apache's point of view, either you're going through mod_perl, or through mod_cgi.
perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'