in reply to Perl as a Holy Weapon?
print "Enter name: "; while (<STDIN>) { chomp; tr/a-zuU/A-ZVV/; for ( split// ) { #Get more function calls, #but the function handles invalid date fine. # if ( /[IVXLCDM]/) # { $sum += RtoD($_); # } } if ($sum == 666) { markOfTheBeast(); last; } else { print "The number is $sum...blessed be!\n"; } $sum = 0; print "Enter name: "; } sub RtoD { $X = shift; return 1 if $X eq 'I'; return 5 if $X eq 'V'; return 10 if $X eq 'X'; return 50 if $X eq 'L'; return 100 if $X eq 'C'; return 500 if $X eq 'D'; return 1000 if $X eq 'M'; return 0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl as a Holy Weapon?
by belg4mit (Prior) on Dec 07, 2000 at 04:01 UTC |