Joel suggested the correct PHP function.
To do it in PERL, you could do this:
Code:
$someText =~ s/\n\n/<p>/g;
$someText =~ s/\n/<br>/g;
And, to answer your question about the spell checker.
vBulletin has it commented out by default, because I believe the service they were using started to charge people.
They just leave the code there in case you want to pay for the service, I think.