$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";