CUFP
vladb
Speaking of <b>unique</b> uses of Perl?
<br><br>
How about predicting the end of times? Do you have Apocalypse on your mind? Well, watch what Perl can do:
<code>
$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";
</code>
Output:
<code>
H - 72
O - 79
L - 76
Y - 89
B - 66
I - 73
B - 66
L - 76
E - 69
Total: 666
</code>
There's actually a lot of other mathematically legitimate ways of obtaining the number <b>666</b>. 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 <b>666</b> as being the number of the beast in the end of times.
<br><br>
_____________________
<code>
# Under Construction
</code>