in reply to Trig in Perl

There are many style issues (indentation, variable naming schemes) that I would change, but the thing that would probably help you most would be to use Perl's built-in trigonometry operators: cos, sin, atan2, etc. Also, you might want to get rid of sub_haiku(), opting for Carp or warn and die. Also use constant PI => 3.14159 would be a more proper way to define pi that $pi = 3.141.

Beyond that, I don't know what to tell you. Through experience (as long as you care about doing things elegantly and efficiently), you will learn how to shorten code and make it look (and be) cleaner and sexier.

Purple Monkey Dishwasher