Speaking of
unique uses of Perl?
How about predicting the end of times? Do you have Apocalypse on your mind? Well, watch what Perl can do:
$x = 0;
$s = "HOLY BIBLE";
#
# add up ASCII codes for all letters in the $s string.
# (also, print out extra information)
#
$s =~ s/(\w)/{$x+=($o=ord($1));print"$1 - $o\n";''}/eg;
print "Total: $x\n";
Output:
H - 72
O - 79
L - 76
Y - 89
B - 66
I - 73
B - 66
L - 76
E - 69
Total: 666
There's actually a lot of other mathematically legitimate ways of obtaining the number
666. I found this one where it's being derived from the word 'HOLY BIBLE' particularly interesting, since it is in this book that a reference is made to
666 as being the number of the beast in the end of times.
_____________________
# Under Construction