You have to follow these rules when creating a block:
In every block you create you have to insert the following code at the beginning:
if (eregi("block-Name_of_Block.php", $PHP_SELF)) {
Header("Location: index.php");
die();
}
By using this code you protect the file avoiding users approaching it directly from the blocks folder, and the block will be displayed only when selected from your site.
In the blocks you can include everything you want, Perl, java, php, flash etc...
All the block output must have a value that can be obtained from the variable $content.
Remember that you have a limited amount of space in the block, pay special attention to the layout!
Warning
In order to have W3C standard compatible blocks, Francisco Burzi says:
"To respect the W3c standards for HTML 4.01 Transitional, it is very important that you replace all "instances of &" in the URL by the tag "& "