|
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
| l |
Original Code
|
|
|
open COST, "<cost.txt" or die "open cost.txt:
$!";
|
|
|
while ($line = <COST>) {
|
|
|
next unless $line =~
m/^\d/;
|
|
|
($prod, $cost) = unpack
'A4 @20 A7', $line;
|
|
|
. . .
|
|
|
| l |
New Code
|
|
|
$costs = $cost_db->prepare('SELECT prod,cost FROM costs');
|
|
$costs->execute;
|
|
|
while ( ($prod, $cost) = $costs->fetchrow_array ) {
|
|
|
. . .
|
|
|
|