Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

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

by james28909 (Deacon)
on Aug 31, 2015 at 05:13 UTC ( [id://1140499]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1140499]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (1)
As of 2024-04-18 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found