Ok.. Some people will think is obvious and stupid, but others newbies like myself might find it interesting. Earlier this week, I learned something new looking at some code in the Camal book on how to get the date using localtime. It uses an anonymous array (??correct term??)of the days of the week to return the day based on the index return by localtime.

So trying this technique out myself i create the one lined roman numeral converter!!

#!/usr/bin/perl -w # pass a number 1..10 to the program print scalar(("I","II","III","IV","V","VI","VII", "VIII","IX","X")[(shift)-1]);

Ok.. Stupid, but cool
zzspectrez

UPDATE:
This can be reduced further following a suggestion from Fastolfe.
print [qw/ I II III IV V VI VII VIII IX X /]->[shift()-1]

Replies are listed 'Best First'.
Re: Simple but cool.. Roman Numerals (useless facts)
by extremely (Priest) on Nov 16, 2000 at 10:48 UTC
    USELESS but interesting FACT: The top two modules for converting between Roman and Arabic numerals (and we are ignoring Lingua::Romana::Perligata for this) are Roman and Text::Roman one written in Japan and one written in Brazil!

    Perl, truly the international language of love, baby!

    --
    $you = new YOU;
    honk() if $you->love(perl)

Re: Simple but cool.. Roman Numerals
by Beatnik (Parson) on Jan 17, 2001 at 03:23 UTC
    This is ofcourse listed in PerlFAQ 4, which points to CPAN.

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.