The stupid question is the question not asked | |
PerlMonks |
Re^2: Creating a random generatorby Anno (Deacon) |
on Sep 25, 2007 at 20:27 UTC ( [id://641035]=note: print w/replies, xml ) | Need Help?? |
First things first. You say
Anywhere you see (AorAn) is where I hope the perl has a nice little way of looking at the first character of the following word and adding "a" or "an". If you don't expect too much, this substitution should do that. It changes th word "a" to "an" if the following word begins with a vowel character. It doesn't deal with "a unicorn" or "an hour" and other vagaries of pronunciation. As to your code, there's a lot of it and I haven't looked at every line by far. One thing that stands out is that there is little separation of code and data. You have a lot of global hashes and arrays, and later ones seem to rely on earlier ones in uncomfortable ways. Ultimately, these would belong in a single (or a few) configurable hashes, with the configuration data in an external file. Otherwise, your code has a massive amount of syntax errors, too many to correct on the fly. It will be nearly impossible to debug remotely, relying only on fatalsToBrowser. You must find a way to run your script locally from a shell so that you can eliminate syntax errors before commiting it to a web server (even a local web server), or indeed, for discussion among perl monks. Anno
In Section
Seekers of Perl Wisdom
|
|