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

use strict; use warnings; print $_ for my ($data) = split ',', <DATA>; __DATA__ 123,456 234,567 345,456 #outputs: '123'
  • Comment on Re: How do I select first string of a two dimensional array to compare to other values?
  • 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 2teez (Vicar) on Aug 31, 2015 at 06:25 UTC

    hi james28909,
    if split operator can take a regex, why not just:

    use strict; use warnings; print split /,.+/, <DATA>; __DATA__ 123,456 234,567 345,456
    Just a flash of thought! :)

    If you tell me, I'll forget.
    If you show me, I'll remember.
    if you involve me, I'll understand.
    --- Author unknown to me