in reply to The inheritance of Cruft

How about this? Can you say 'use a hash array' or 'use "my", not "local"', or even 'you don't need an index counter in a for loop':
sub doLookup { local($str,$i); $str = $_[0]; # Is this an IgnoredWord? for ($i = 0; $i < @gIgnoreWords; $i++) { if ($str eq $gIgnoreWords[$i]) { return ""; } } # Is this a ReplacedWord? for ($i = 0; $i < @gOldWords; $i++) { if ($str eq $gOldWords[$i]) { return $gNewWords[$i]; } } return $str; }

Replies are listed 'Best First'.
RE: RE: The inheritance of Cruft
by arturo (Vicar) on Oct 25, 2000 at 01:31 UTC
    Dang! Your predecessor must have been picking the pocket of the person who bequoth me all the code I maintain =)

    Not a foreach (@array) in the lot, mind you. and local() always, never my(). Granted, her code *works*, and she learned Perl on the job.

    Philosophy can be made out of anything. Or less -- Jerry A. Fodor