in reply to can this perl script be explained how and what it is going on...????

This script counts the number of times a specifc character occurs in each position in a list of fixed length words.

As for how it does it, well it splits each of the fixed length words into single character arrays and iterates over them incrementing a hash value for that character in that position. (Perl expresses this much better ;) )

It then assigns the value 0 to undefined elements.

Stick a few print statements in, use Dumper to examine variables and see what changes are being made and it will become clearer

print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."
  • Comment on Re: can this perl script be explained how and what it is going on...????
  • Download Code