Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^7: Get just the unique value

by CountOrlok (Friar)
on Apr 05, 2013 at 18:27 UTC ( #1027195=note: print w/replies, xml ) Need Help??


in reply to Re^6: Get just the unique value
in thread Get just the unique value

Maybe if you gave us the desired output...

Replies are listed 'Best First'.
Re^8: Get just the unique value
by Anonymous Monk on Apr 05, 2013 at 18:59 UTC
    Sure, the end result is that $data only holds the unique values: From this:
    my $data = [ { 'type' => 'Paper' }, { 'type' => 'Paper' }, { 'type' => 'Plastic' }, { 'type' => 'Plastic' }, { 'type' => 'Plastic' }, { 'type' => 'Plastic' }, { 'type' => 'Cotton' }, { 'type' => 'Cotton' }, { 'type' => 'Cotton' }, { 'type' => 'Cotton' }, { 'type' => 'Cotton' }, { 'type' => 'Paper' }, { 'type' => 'Paper' }, { 'type' => 'Paper' }, { 'type' => 'Paper' }, { 'type' => 'Paper' }, ];
    To that:
    $data = [ { 'type' => 'Paper' }, { 'type' => 'Plastic' }, { 'type' => 'Cotton' }, ];
      hdb's code does exactly that, albeit sorted.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1027195]
help
Chatterbox?
[planetscape]: sleep well, Corion
[stonecolddevin]: erix seems pretty good, i listened to "So Many Roads" and it was nice. Not everyone's cup of tea but this guy can absolutely shred, he and the guy from Mastodon are definitely up there: https://www. youtube.com/watch? v=VzhMkSN9dQc
[erix]: ha, good stuff - loud and fast...
[stonecolddevin]: here's some Mastodon for when you have 13 minutes to have your mind blown: https://www. youtube.com/watch? v=4pvfQtUhtNE
[karlgoethebier]: goes to Brownsville one more time..

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2017-06-22 21:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (531 votes). Check out past polls.