LostS has asked for the wisdom of the Perl Monks concerning the following question:
open (DBASE,"$hrdata/$qfile"); @ODB=<DBASE>; close (DBASE); open (DATABASE,">$hrdata/$qfile"); foreach $rec (@ODB){ chomp($rec); ($oldpositionid,$oldinstitution,$olddepartment,$oldconfirstname,$oldc +onlastname,$oldconemail,$oldconphone,$oldtitleposition,$oldposnumber, +$oldtypeposition,$oldprogramtype,$olddvmonth,$olddvday,$olddvyear,$ol +dedmonth,$oldedday,$oldedyear,$oldnumposition,$oldnumvacunit,$oldtots +alary,$oldbudgetsalary,$oldstatefundsources,$oldfedfundsources,$oldst +atebudgetcat,$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$oldtitle +position\t$oldposnumber\t$oldtypeposition\t$oldprogramtype\t$olddvmon +th\t$olddvday\t$olddvyear\t$oldedmonth\t$oldedday\t$oldedyear\t$oldnu +mposition\t$oldnumvacunit\t$oldtotsalary\t$oldbudgetsalary\t$oldstate +fundsources\t$oldfedfundsources\t$oldstatebudgetcat\t$oldpriclass\t$o +ldsubip\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$ +edday\t$edyear\t$numposition\t$numvacunit\t$totsalary\t$budgetsalary\ +t$statefundsources\t$fedfundsources\t$statebudgetcat\t$priclass\t$ENV +{REMOTE_ADDR}\t$thetime\tNo\n"; } } close (DATABASE);
perl -e '$cat = "cat"; if ($cat =~ /\143\x61\x74/) { print "Its a cat! +\n"; } else { print "Thats a dog\n"; } print "\n";'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: OK... I am confused and lost :( Editing FlatFile
by runrig (Abbot) on Aug 27, 2001 at 22:41 UTC | |
by LostS (Friar) on Aug 27, 2001 at 22:50 UTC | |
|
Re (tilly) 1: OK... I am confused and lost :( Editing FlatFile
by tilly (Archbishop) on Aug 28, 2001 at 21:14 UTC |