in reply to filehandles and such
Notes:$infile = shift || die "Need a filename!\n"; open(INFILE, "$infile") || die "Could not open $infile: $!\n"; while(<INFILE>) { chop; tr/A-Z/a-z/; ## lowercase all characters s/\s+/ /g; ## remove extra spaces for $x (split(/\d*\./, $_)) { ## Set each to "0" if not found in the hash: $site = $site{$x} || "0"; $specimin = $specimin{$x} || "0"; $procedure = $procedure{$x} || "0"; ## Do not go on if any were not found: next unless ($site && $specimin && $procedure); ## Grab the results of assigncode: $code=&assigncode($site,$specimen,$procedure); ## Exit while loop if a good $code is found: last if $code; } } close(IN); print "$code " if $code; print "$line\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
thanks for the help
by g man (Initiate) on Apr 26, 2000 at 06:26 UTC |