Text generation using Markov Chains in Perl