Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
First Column is called PDB second PIC. If i have a sumber stored in $NUM17 = 25. I need to make sure that $NUM17 appears in column one then print its corresponding PIC, column 2 number. I thought something along:18 56 25 10 12 45
thanks, #print "$value\n";while (<DATA>) { ($PDB, $PIC) = split (/\s+/, $_) if (/^\d+.*/); } @pic = $PIC; @pdb = $PDB; $endpdb = scalar @pdb; for ($count = 0; $count < $endpdb; count++;) { if ($PDB == $NUM17) {$value = $pic[$count]}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Working with Arrays
by davorg (Chancellor) on Jul 07, 2004 at 12:25 UTC | |
by Anonymous Monk on Jul 07, 2004 at 12:30 UTC | |
|
Re: Working with Arrays
by naChoZ (Curate) on Jul 07, 2004 at 12:06 UTC | |
by Anonymous Monk on Jul 07, 2004 at 12:10 UTC | |
by revdiablo (Prior) on Jul 07, 2004 at 17:46 UTC | |
|
Re: Working with Arrays
by naChoZ (Curate) on Jul 07, 2004 at 12:17 UTC |