in reply to How do I select first string of a two dimensional array to compare to other values?

I have a two dimensional array after splitting a text document into three different columns.

You split with
    my @splits = split (',', $line);
to the array  @splits which has one dimension. On what do you base your assertion that you have a two-dimensional array?

You assign the first element of  @splits to  $first_value and then print  $first (which is never defined) immediately afterward. How does | can that work with strict enabled?

Can you supply a short, representative example or two of your input data? We could then use this for testing various alternatives.

Also, please see the Short, Self Contained, Correct (Compilable), Example discussion.


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

  • Comment on Re: How do I select first string of a two dimensional array to compare to other values?
  • Select or Download Code

Replies are listed 'Best First'.
Re^2: How do I select first string of a two dimensional array to compare to other values?
by joi1369 (Initiate) on Aug 31, 2015 at 00:58 UTC

    I said this above as well but, the non-defined "$first" was completely my fault. I was trying to clarify the code a bit once I had put it on the site and then ended up forgetting to change the other one. The input looks like this-

    1424621700, 2015-02-22 16:15:00, 4294.700 1424621760, 2015-02-22 16:16:00, 4289.700 1424621820, 2015-02-22 16:17:00, 4299.800 1424621880, 2015-02-22 16:18:00, 4302.800 1424621940, 2015-02-22 16:19:00, 4296.900 1424622000, 2015-02-22 16:20:00, 4301.000

    And I'm trying to get the value "1424621700" returned after the file is split at the commas.

      Please see above.


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