Prefixed to STDERR, right before the words Out of Memory. Well at least bash error messages make it clear they are from bash.Perl is in the habit of assuming everybody knows its messages come from perl.
And now the kernel assumes people can guess they come from the kernel. Anyway, I bet half the people who see this message, https://www.google.com/search?q=perl+out+of+memory assume it is perl making it. And... not everybody looks or can look at kernel logs.