Code can be displayed in filtered HTML or full HTML. To display code, you have two solutions:
Using the second, Drupal will format your code using the VIM-color module. Note that the <code> syntax can recognize code automatically from the first line like in
<code type="perl"> #!/usr/local/bin/perl use DBI; print "Hello world\n"; </code>
which will be displayed as
#!/usr/local/bin/perl use DBI; print "Hello world\n";
WARNING: Note that switching between enable rich-text and normal mode while using <code> may scramble your formating. This was also noted in ... create a cross-reference to another page.