ahmad you rock. Here’s the version with a class instead of print
<ul class="sidebar-ul">
<?php
$IDOutsideLoop = $post->ID;
global $post;
$myposts = get_posts('showposts=5');
foreach($myposts as $post) :
?>
<li <?php
if(is_single() && $IDOutsideLoop == $post->ID)
{
echo " class=\"current\"";
}
?>>
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
of course set your own css