http://www.perlmonks.org?node_id=110000


in reply to Trig in Perl

I used to see code like this a lot - this is more or less how many people wrote Fortran. There are *lots* of variables being passed to most of the subroutines - COMMON blocks. There are many many lines each doing some simple arithmetical manipulation. The main control of program flow seems to be through a couple of globals - whatfound and whatfound0.

I could never fix, understand or maintain code in this style, and I used to rewrite it as it was ultimately less painful.

It is faster to write code like this, for something that will only be done once. If it's going to be done twice, you should reconsider your basic design. Also if it doesn't currently work properly, as you suggest, a rewrite on more organised lines is probably the fastest way of fixing it.

-- Anthony Staines

Replies are listed 'Best First'.
Re: Re: Trig in Perl
by John M. Dlugosz (Monsignor) on Sep 04, 2001 at 21:05 UTC
    Actually, those variables are not being passed! He seems to declare all his local vars as a parameter list, but @_ doesn't contain all that. It's usually empty, in fact.