Date: Mon, 27 Aug 2001 12:09:51 -0700 (PDT)
From: Amit Indap <XXXXXX@XXXX.stanford.edu>
To: mjd-tpc-flags@plover.com
Subject: red flags and families of variable names
Message-ID: <Pine.GSO.3.96.1010827120441.2663A-100000@manatee.stanford.edu>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Dear Dominus,

I attended your Perl Repair Shop and Red Flags workshop at TPC this past July. Regarding the use of avoiding families of variable names I found this code on PerlMonks today it is even more unbelivable than the example shown in your slides at TPC!:

  
  open (DBASE,"$hrdata/$qfile");
  @ODB=<DBASE>;
  close (DBASE);
  open (DATABASE,">$hrdata/$qfile");
  foreach $rec (@ODB){
   ($oldpositionid,$oldinstitution,$olddepartment,$oldconfirstname,$oldc
  +onlastname,$oldconemail,$oldconphone,$oldtitleposition,$oldposnumber,$
  +oldtypeposition,$oldprogramtype,$olddvmonth,$olddvday,$olddvyear,$olde
  +dmonth,$oldedday,$oldedyear,$oldnumposition,$oldnumvacunit,$oldtotsala
  +ry,$oldbudgetsalary,$oldstatefundsources,$oldfedfundsources,$oldstateb
  +udgetcat,$oldpriclass,$oldsubip,$oldthetime,$oldapproved) = split(/\t/
  +,$rec);
   if ($oldpositionid != $viewpositionid) {
    print DATABASE "$oldpositionid\t$oldinstitution\t$olddepartment\t$ol
  +dconfirstname\t$oldconlastname\t$oldconemail\t$oldconphone\t$oldtitlep
  +osition\t$oldposnumber\t$oldtypeposition\t$oldprogramtype\t$olddvmonth
  +\t$olddvday\t$olddvyear\t$oldedmonth\t$oldedday\t$oldedyear\t$oldnumpo
  +sition\t$oldnumvacunit\t$oldtotsalary\t$oldbudgetsalary\t$oldstatefund
  +sources\t$oldfedfundsources\t$oldstatebudgetcat\t$oldpriclass\t$oldsub
  +ip\t$oldthetime\t$oldapproved\n";
   } else {
    print DATABASE "$viewpositionid\t$institution\t$department\t$confirs
  +tname\t$conlastname\t$conemail\t$conphone\t$titleposition\t$posnumber\
  +t$typeposition\t$programtype\t$dvmonth\t$dvday\t$dvyear\t$edmonth\t$ed
  +day\t$edyear\t$numposition\t$numvacunit\t$totsalary\t$budgetsalary\t$s
  +tatefundsources\t$fedfundsources\t$statebudgetcat\t$priclass\t$ENV{REM
  +OTE_ADDR}\t$thetime\tNo\n";
  }
  close (DATABASE);

[Note: the + signs in the left margin are a PerlMonks convention for displaying long source code lines that would not otherwise fit in the window. -- MJD]


Amit Indap

Stanford Human Genome Center
Email: XXXXXX@XXXX.stanford.edu

"Where is the frontier?"
- W. Daniel Hillis