# Reading the CSV file

## open MARGIN, “<margin.csv” or die “open margin.csv: $!”;

## while (<MARGIN>) {

## chop;

##

## ($prod, $margin, $notes) = split /,/;

##

## $prod_margin{$prod} = $margin;

## $prod_notes{$prod} = $notes;

## }

Previous slide | Next slide | Back to first slide | View graphic version

Notes:

Very few lines of code.

Just about every line directly related to the task.

Not the best code in the world but it gets the job done.

(The split could be replaced with two lines of code to do the right thing

with quoted fields and embedded commas, for example.)