in reply to Re: Manually incrementing @ array during for
in thread Manually incrementing @ array during for

Is there a reason you're not just processing the lines as you read them from the file?

According to this, the code for which cniggeler is responsible "... is part of a much bigger body of code, and I receive the already created @array, ... the @array may be used elsewhere." Then IIUC, it's not possible for cniggeler to parse the data at the point of access (which I agree would likely be simpler and more efficient).


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^3: Manually incrementing @ array during for
by kcott (Archbishop) on Mar 17, 2020 at 20:54 UTC

    Fair enough. I obviously missed the later post where the goal posts were moved. :-)

    The second of my two solutions would work equally well for an array. The chomp may not be necessary: hard to tell as the example input data presented in the OP looks more file data than array data.

    — Ken