One of the many useful features of the XyUser Blog is the ability to post formatted code in your posts using the pre tag.
Pre takes two fields, lang (for the language) which is required and lineno (for line numbering) which is optional.
e.g.
lang will take the following:
abap, actionscript, ada, apache, applescript, asm, asp, autoit, bash, blitzbasic, bnf, c, c_mac, caddcl, cadlisp, cfdg, cfm, cpp-qt, cpp, csharp, css-gen, css, d, delphi, diff, div, dos, dot, eiffel, fortran, freebasic, genero, gml, groovy, haskell, html4strict, idl, ini, inno, io, java, java5, javascript, latex, lisp, lua, m68k, matlab, mirc, mpasm, mysql, nsis, objc, ocaml-brief, ocaml, oobas, oracle8, pascal, per, perl, php-brief, php, plsql, python, qbasic, rails, reg, robots, ruby, sas, scheme, sdlbasic, smalltalk, smarty, sql, tcl, text, thinbasic, tsql, vb, vbnet, vhdl, visualfoxpro, winbatch, xml, xpp, z80
and lineno needs to be given an intial value, eg 1.
This will give the following:
################
## Mail send ##
################
my $sender = new Mail::Sender
{
smtp => $smtpserv,
};
$sender->OpenMultipart({from => 'administrator@letterpart.com',
to => $smtp_email_address,
client => $mailclient,
subject => $mesgsubject} ) or die "Error: $!\n";
$sender->Body(
{ctype => "text/html",
encoding => "7bit",
msg => "$email_body" });
$sender->SendEnc() or die "Error: $!\n";
$sender->Close() or die "Error: $!\n";
}
If you would like to add support for further languages, please email us and we can supply you with an example .php file to edit and amend.

Tip of the month
4 users commented on " How to post code "
Follow-up comment rss or Leave a TrackbackHedley, how did the >’s arrive in your sample. Do the ‘>’ get converted automatically or what?
Good question Bart. I will look into it further.
Thanks for the heads up.
Oh and Hedley, what does the lang=”xpp” actually do?
Also many thanks for including z80 and m68k in the list of supported languages, brings back a lot of good memories. Once created an interface between a linotype OCR (parallel) and a Compugraphic MCS (serial) using a Motorola 68000 based board, which you had to program from scratch in machine code. That was fun.
Does anybody remember the name of the serial interface + translation program on the MCS series (plus bonus question: on the Editwriter series)?