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.
redmistPurple Monkey Dishwasher
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: (redmist) Re: Trig in Perl
by Hofmator (Curate) on Sep 04, 2001 at 12:58 UTC | |
by dr_lambado (Hermit) on Sep 04, 2001 at 20:59 UTC |
In Section
Seekers of Perl Wisdom