Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^4: Adding the duplicate data using arrays

by changma_ha (Sexton)
on Aug 11, 2010 at 10:07 UTC ( [id://854305]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Adding the duplicate data using arrays
in thread Adding the duplicate data using arrays

Ok..JavaFan. If i have the data "Apple banana 100" if i split on the basis of "\s+" it will split Apple and Banana...so how can i split in such a way that "Apple Banana " is the key and "100" is the value...give me some wisdom

  • Comment on Re^4: Adding the duplicate data using arrays

Replies are listed 'Best First'.
Re^5: Adding the duplicate data using arrays
by JavaFan (Canon) on Aug 11, 2010 at 10:48 UTC
    my ($fruit, $value) = "Apple banana 100" =~ /^(.*\S)\s+([0-9]+)/;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-09-16 12:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The PerlMonks site front end has:





    Results (22 votes). Check out past polls.

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.