in reply to Adding Array References to an Array

It's going to be a tad difficult to figure out what's going on without enough data (a sample of the input file, say). It may well be that you're getting 1 element because that's all there is.

There are some stylistic issues with your code:


added in update

As chromatic notes, in his response, replacing

if($tfl_contents[9] ne "")

with

if($tfl_contents[9])

may also be worse, e.g. if there's a 0 in that location.

emc

At that time [1909] the chief engineer was almost always the chief test pilot as well. That had the fortunate result of eliminating poor engineering early in aviation.

—Igor Sikorsky, reported in AOPA Pilot magazine February 2003.

Replies are listed 'Best First'.
Re^2: Adding Array References to an Array
by chromatic (Archbishop) on Dec 29, 2006 at 00:39 UTC
    if($tfl_contents[] ne "") (you did have a null string, no?) may be better written as if($tfl_contents[9]).

    It may be worse, too, if there's a 0 in that slot.