Posted on Dec 11, 2008

Stupid Bug

I spent an hour trying to figure out what a field in a fixed width file was being truncated by one character. This is what I found:

Definition

<header start=”1″ end=”8″>accountnum</header>

Calcuation

$length = $header->{end} – $header->{start}

Great, except that columns 1 THROUGH 8 total 8, not 7. Ugh.